I have checkbox value in the gridview which is bound to item template in this manner:
<ItemTemplate>
<asp:CheckBox ID="CheckBoxDisable" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBoxDisableEvent"/>
</ItemTemplate>
And i’m implementing the CheckBoxDisableEvent method in this manner which does nothing but store the checkbox checked value into sql server table.
SqlCommand cmd = new SqlCommand("InsertDisableFlagIntoComponents", connection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@disableFlag", SqlDbType.Int).Value = disableFlag;
Now the problem is when the gridview loads on the start of the project next time, i want to enable all those checkboxes depending upon the value that i have stored in database during previous events.
How can i enable the checkbox values in gridview depending on the values that i stored in sql server table.
BTW i’m using vs2008 with asp.net/C#, sqlserver 2005
Thanks in anticipation
1 Answer