I have a simple datagrid that is bound to a filtered dataset. The filter attributes can be selected from a number of dropdown lists on the form, and the form posted back.
The problem I have is that a bound textbox control in the datagrid does not update when the form is posted, whereas all the other bound columns do.
<asp:TemplateColumn ItemStyle-Wrap="False" HeaderText="Match Date" ItemStyle-HorizontalAlign="Center">
<itemtemplate>
<asp:Textbox CssClass="fixdate" Width="100" Runat="server" ID="txtMatchDate" Text='<%# Container.DataItem("MatchDate")%>' ></asp:Textbox>
</itemtemplate>
</asp:TemplateColumn>
<asp:BoundColumn ReadOnly="True" DataField="MatchDate" HeaderText="Match Date" SortExpression="MatchDate"></asp:BoundColumn>
The two columns show above both bind to the MatchDate field. The BoundColumn shows show the corrrectly bound data at every postback, whereas the textbox in the TemplateColumn always shows the data from the first time time it is bound.
The problem I have is that a bound textbox control in the datagrid does not update when the form is posted, whereas all the other bound columns do.
<asp:TemplateColumn ItemStyle-Wrap="False" HeaderText="Match Date" ItemStyle-HorizontalAlign="Center">
<itemtemplate>
<asp:Textbox CssClass="fixdate" Width="100" Runat="server" ID="txtMatchDate" Text='<%# Container.DataItem("MatchDate")%>' ></asp:Textbox>
</itemtemplate>
</asp:TemplateColumn>
<asp:BoundColumn ReadOnly="True" DataField="MatchDate" HeaderText="Match Date" SortExpression="MatchDate"></asp:BoundColumn>
The two columns show above both bind to the MatchDate field. The BoundColumn shows show the corrrectly bound data at every postback, whereas the textbox in the TemplateColumn always shows the data from the first time time it is bound.