I have a datagrid with the columns defined in the aspx
<columns>
<asp:TemplateCo lumn HeaderText="Hou rs" ItemStyle-Width="1%"ItemS tyle-HorizontalAlign ="Center">
<ItemTemplate >
<asp:TextBox Columns="2" EnableViewState ="False" ID="Hours"Runat ="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateCol umn>
...
</columns>
I have other bound columns that display the correct data so Iknow the dataset is ok.
Here's the problem. In
dgTest_ItemBoun d(...) Handles dgTest.ItemData Bound
I have:
CType(e.Item.Ce lls(3).FindCont rol("Hours"), TextBox).Text =drv("TotalHour s").ToString
When I make the first request, the hours txtbox is populatedcorrec tly. Any rebinding after that, the value is unchanged. Ifthe box initially was filled with '20' and the grid was reboundto contain 0 hours, 20 remains, even though another bound columncontainin g 'TotalHours' DOES change. This is very strange. Anyideas?
I've already tried things with viewstate on/off for the dg andtxtbox. I've already tried adding the textbox controldynamica lly and clearing it, etc. No good.
I also tried using <asp:textbox><% # eval....contain er...%></asp:textbox> but you can't do that for other reasons.
Any help if appreciated. Thank you.
--------------------------------
From: Michael Haren
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>/SNv1WoZ0kqnEWLy QtolIQ==</Id>