how to add a multiselect chkbox in datagriedview in vb.net windows

Posted by Shanky11 under VB.NET on 3/5/2013 | Points: 10 | Views : 1187 | Status : [Member] | Replies : 2
i hav a griedview in vb.net sms application
for this i need a multi-select checkbox
how can i have it ????????????????????????????????




Responses

Posted by: Somasundaram on: 3/5/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Check this link, it will be useful for u.

http://www.asp.net/web-forms/tutorials/data-access/enhancing-the-gridview/adding-a-gridview-column-of-checkboxes-vb
Thanks,
Somasundaram

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

Posted by: Santhi on: 3/5/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

If you need checkbox on all the rows.
You have to do like this.
your aspx page should be
<Columns>

<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkSelect runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>

Code behind should be like this

foreach(GridViewRow gvrow in gvUserDetails.Rows)

{
CheckBox chkSelect = (CheckBox)gvrow.FindControl("chkSelect ");
if(chkSelect .Checked)
{
your code
}
}


Thanks & Regards,
Santhi .V

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

Login to post response