jeudi 18 février 2016

CheckEdit in GridControl behaves weirdly

I have devexpress gridcontrol which has a CheckEdit in one of the columns. I check all of them in the grid and click a button. In the clickevent of the button, I am trying to get the checked rows with code below....

private void btnExcelDeleteSelected_Click(object sender, EventArgs e)
{
    var selectRecord = excelList.Where(p => p.CHECK.Equals(1)).ToList();
}

The problem is that, as you can see, first cell still has focus. Because of that focus, Where() function above returns 2 rows as checked. However, if I focus somewhere else and click the button, It returns 3 rows as checked.

How can get the correct result(which is 3 in this case) whether there is focus on a cell or not?

enter image description here




Aucun commentaire:

Enregistrer un commentaire