Hi,
I have two template columns in my datagrid, code for which I have put in the html page like so:
<columns>
<asp:TemplateColumn HeaderText="Assigned">
<ItemTemplate>
<asp:CheckBox ID="cbAssigned" Runat="server"
Checked = '<%#DataBinder.Eval(Container.DataItem,"IsAssigned ")%>' Enabled="False" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Reassign">
<ItemTemplate>
<asp:LinkButton ID="Reassign" text="Reassign"
CommandName="Reassign" Runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="LoginName" HeaderText="LoginName">
<HeaderStyle ForeColor="White" BackColor="Maroon"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
</columns>
The first template column has checkboxes, which binds to a column in datasource, as in the code above.
Second template column has asp:linkbuttons, pressing which calls a function called Reassign,
which I have defined in my VB.NET codebehind.
After the page loads, I press a button called search, which gets the info from the database and binds the grid to the datasource. At that time, I can see my appropriate checkboxes checked.
When I click the "reassign" link in a row, I make some changes to the datasource, update the database and rebind the grid to the source. When the page loads again, I can see changes in all the appropriate boundcolumns (including the one that I show above in the code), but not in the checkboxes.
What am I missing? As you might expect, page_load is called before the reassign event is fired. Why should databind bind only a few columns?
Any input will be appreciated.