I have an Obout Grid with custom filters that is used to display information about two different items with similar but slightly different fields. They share two columns and two others switch visibility depending on which item is being displayed in the grid. The custom filters are used to sort a couple of the columns with start and end dates and another is sorted with a dropdown. When the page first loads, all the filters are working correctly but when I click the link that causes the postback to switch the items in the grid, the filters no longer work quite correctly. The text filters still function, but the dropdown no longer has any options and the Obout date pickers no longer populate the text boxes next to them that show the selected date. However if you type a date in, it still sorts properly so the filter itself isn't broken.
I've tried the grid both with and without an UpdatePanel around it and calling updates when the context switches but the behavior did not change.
Is there any reason that the dropdown would lose its options or that the date picker would lose its connection to the textboxes?
Custom Date Filter:
<obout:GridTemplate ID="templateDateIssuedFilter" runat="server">
<Template>
<table>
<tr>
<td>
<asp:Literal ID="litDateIssuedFrom" runat="server" Text="From" />
</td>
<td>
<obout:OboutTextBox ID="txtDateIssuedFrom" runat="server" Width="180px">
<ClientSideEvents OnKeyUp="applyFilter" />
</obout:OboutTextBox>
<obout:Calendar runat="server" DatePickerMode="true" TextBoxId="txtDateIssuedFrom" OnClientDateChanged="applyFilter" DatePickerImagePath="OboutControls/Calendar/styles/date_picker1.gif" />
</td>
</tr>
<tr>
<td>
<asp:Literal ID="litDateIssuedTo" runat="server" Text="To" />
</td>
<td>
<obout:OboutTextBox ID="txtDateIssuedTo" runat="server" Width="180px">
<ClientSideEvents OnKeyUp="applyFilter" />
</obout:OboutTextBox>
<obout:Calendar runat="server" DatePickerMode="true" TextBoxId="txtDateIssuedTo" OnClientDateChanged="applyFilter" DatePickerImagePath="OboutControls/Calendar/styles/date_picker1.gif" />
</td>
</tr>
</table>
</Template>
</obout:GridTemplate>
After some playing around, I found that the date pickers just seemed to lose association with their textbox and just need to be reminded. I couldn't find a reason why this happened but it did occur with every postback on the page. I added some code to find the date pickers and reassign the TextBoxId attribute for all of them after every postback.
For the dropdown list, I had to re-add all the options at every postback as well.