hi sir,
How to get checked checkedListbox items in datagridview in asp.net5 c#?
please help me.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Brijendra GautamPosted Mar 21, 2014, 5:24 AM
Are you talking about the CheckBoxList control in gridview row then the solution is below:
foreach(GridViewRow gr in gridview1.Rows){
CheckBoxList cbx = (CheckBoxList) gr.FindControl("
foreach(ListItem cbk in cbx.Items){
if(cbk.Selected){
// Do your work here
}
}
}
Since CheckBoxList has multiple selection option, so you need for loop to get all the selection. SelectedItem property of list will give only first item.
Lakshmanan Sethu SankaranarayanPosted Mar 21, 2014, 5:01 AM