Hi,
Sometimes CellEventArgs for ClickCellButton event contains wrong cell.
In the event I'm extracting data from a cell within the same row as clicked cell, and then refresh the whole grid.
Sometimes (when I click the button again just before it returns to unclicked state - the click event execution takes some time) the retrieved data is from some other row.
Is it me doing something wrong or is it bug in your control?
P.S. This is what i get on my trace (After activate is traced in AfterRowActivate event). Proper value is 91. The value 88 is from 91's parent row:
[2011-02-04 18:22:42] After activate 91
[2011-02-04 18:22:42] Click, id = 91
[2011-02-04 18:22:43] After activate 88
[2011-02-04 18:22:43] After activate 143
[2011-02-04 18:22:43] Click, id = 143
[2011-02-04 18:22:44] After activate 142
[2011-02-04 18:25:06] After activate 91
[2011-02-04 18:25:06] Click, id = 91
[2011-02-04 18:25:07] After activate 88
[2011-02-04 18:25:08] After activate 91
[2011-02-04 18:25:08] Click, id = 91
[2011-02-04 18:25:08] After activate 88
Inqb said: In the event I'm extracting data from a cell within the same row as clicked cell, and then refresh the whole grid.
Yes - the cell is different. So should be the row.
The following code:
e.Cell.Row.GetCellValue("EventTypeID");
returns wrong value.
Let's suppose, that the new Click is generated upon clicking old (before refresh) cell and by the time the main thread begins executing the event, the new grid is loaded. What should happen? Should the e.Cell field contain reference to some random cell from new grid?
Anyway, everything should be fine, as the refreshing is not asynchronous and it's between BeginUpdate() and EndUpdate(). And even if it wasn't, shouldn't the newly rendered row, contain proper references (or are they initialized with some garbage and set to proper values later?)