Home > Software engineering >  I traverse in winform datagrieview checkbox in the problem
I traverse in winform datagrieview checkbox in the problem

Time:10-05

In winform I traverse the checkbox in the datagrieview, on the front end both selection and alternative, only won the largest checkbox index; But when the radio is normal, is this why?
 
String id="";
Int I=dgv_BackAd. Rows. Count;
For (int s=0; S & lt; i; S++)
{
If (dgv_BackAd. Rows [s]. Cells [r]. "checkBox" Selected)
{
Id=id + dgv_BackAd. Rows [s] Cells [5]. The Value + ", ";
}
}

CodePudding user response:

Should get Checked attribute, rather than Selected

CodePudding user response:

reference 1st floor caozhy response:
should get Checked attribute, rather than Selected

My train of thought is the front-end resulting from the traversal of the checkbox is selected, only the selected one is normal and correct, if not correct, select multiple, through debugging that can only achieve index for greater checkbox is selected, the way you said don't understand
  • Related