netpicker9
01-17-2007, 08:22 PM
Hi,
I have Three questions
I have checkbox in GridView with AutoPostBack="True"
Question 1.
Once I click the checkbox, page is refreshing and checkbox is showing as unchecked..
How to show/keep the checkbox in checked state??
Code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID" />
<asp:BoundField DataField="CategoryName" HeaderText="CategoryName" />
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Question 2.
If I place a Breakpoint here, Control is not coming here..
Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim checkbox As CheckBox = CType(sender, CheckBox)
Dim row As GridViewRow = CType(checkbox.NamingContainer, GridViewRow)
End Sub
Question 3:
Is there anyway, I can refresh the GridView only without refreshing whole page.. (without Ajax, because I am using asp.net 2.0)
Thanks in advance.
I have Three questions
I have checkbox in GridView with AutoPostBack="True"
Question 1.
Once I click the checkbox, page is refreshing and checkbox is showing as unchecked..
How to show/keep the checkbox in checked state??
Code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID" />
<asp:BoundField DataField="CategoryName" HeaderText="CategoryName" />
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Question 2.
If I place a Breakpoint here, Control is not coming here..
Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim checkbox As CheckBox = CType(sender, CheckBox)
Dim row As GridViewRow = CType(checkbox.NamingContainer, GridViewRow)
End Sub
Question 3:
Is there anyway, I can refresh the GridView only without refreshing whole page.. (without Ajax, because I am using asp.net 2.0)
Thanks in advance.