How to use a checkbox in a data grid?

Posted by Saranya Boopathi under ASP.NET on 6/11/2013 | Points: 10 | Views : 686 | Status : [Member] | Replies : 4
How to use a checkbox in a data grid in ASP.net?

Saranya Boopathi


Responses

Posted by: Satyapriyanayak on: 6/11/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
http://support.microsoft.com/kb/306227
http://www.codeproject.com/Articles/7629/Using-CheckBoxes-within-the-DataGrid-control-to-se

If this post helps you mark it as answer
Thanks

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 6/14/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
You can use the below code in you .aspx file.

<asp:DataGrid ID="dgTestGrid" Runat="server" AutoGenerateColumns=True border="0" width="50%">
<Columns>
<chkbox:CheckBoxColumn/>
</Columns>
</asp:DataGrid>

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raj.Trivedi on: 6/14/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello

if you are thinking for an action to be made on checkbox then you will have to use itemtemplate and in in itemtemplate you use checkbox

<asp:DataGrid ID="mygrid" Runat="server" AutoGenerateColumns="false">
<asp:TemplateField HeaderText="Checkbox">
<ItemTemplate>
<asp:Checkbox ID="chkid" runat="server" </aspCheckbox>
</ItemTemplate>
</asp:TemplateField>

</asp:DataGrid>

Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Arul44ece on: 6/20/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Please try the below code.

<asp:DataGrid ID="grid" Runat="server" AutoGenerateColumns="false">

<asp:TemplateField HeaderText="Checkbox">
<ItemTemplate>
<asp:Checkbox ID="check" runat="server" </aspCheckbox>
</ItemTemplate>
</asp:TemplateField>

</asp:DataGrid>


Regards,

Arul R
arul44.ece@gmail.com

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response