Hai,
Welcome all, The web page using C#, have on datagrid. I bind data from sqlserver database successfully.I bound some datas from sqlserver successfully. Now I added one check box in itemtemplate tab. I need only one tick in one checkbox in datagrid, I dont want multiple selection, I need to prevent multiple selection in datagrid, If the client select any second checkbox, should show the error message like this " You can select only one item from datagrid" . Please help me?
Regards,
Manu.
Loading

Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 12, 2010, 1:47 AM EST
another way of doing it is you can disable rest of the check boxes on CheckBox selection change event.
for (int i = 0; i < GridView1.Rows.Count; i++)
Please mark as answer if it helps you.
Manu Raj3 reputationPosted Mar 12, 2010, 5:03 AM EST
This is not enough. How can i set the event in checkbox, becauseit is in the gridview inner control. I need only only one check box selection at whole gridview? please help me?
Regards,
Manu,
Sam HobbsRank #107 · 20.5K reputationPosted Mar 12, 2010, 6:00 PM EST
hdk bht4 reputationPosted Mar 13, 2010, 10:25 PM EST
Try writing Javascript code which will disselect the other checkbox on selection of one checkbox..
This way user is mandatory to select only one checkbox.
Let me know if that helps.
Thanks