I have a DataGridView
with a CheckBox
first column.
I use the following Linq to get all the checked rows.
DataGridViewRow[] drs = dgvMain.Rows.Cast<DataGridViewRow>().Where(x =>(!Convert.IsDBNull(x.Cells[0].Value) && Convert.ToBoolean(x.Cells[0].Value))).ToArray();
But somehow the result ALWAYS missing the last checked row!!!
BUT, if I select another roll (not checking it), before I run the line, the last row showed up!!!
Could somebody please be so kind and tell me where did I do wrong!?
Much appreciated!!!