Hi, I am using the CurrentCellActivatedCommand event on the control to detect if a user clicks any of columns 2 to 3 within a 6 column layout. Within my grid, I have a DetailsViewDefinition and when the application runs, I get the default Expand/Collapse column appear correctly.
The issue is that when I use the above Event and a user clicks the Expand/Collapse button of a row, I get the correct Row returned within the CurrentCellActivatedEventArgs however the column reference is incorrect. It appears to be the last non-expand collapse column that was selected in any other row. e.g. If I click column 5 on Row 2 and then click column 1 (Expand/Collapse column) on Row 10, the CurrentCellActivatedEventArgs shows 10 as the row index (correct) but 5 for the column index (wrong)
Is there some property I need to change to get this to work or would a different Event be better for this? I essentially want some action to occur only if a user clicks in columns 2 or 3 of the grid and not if a user is just clicking the Expand/Collapse button
JGJai Ganesh S Syncfusion Team August 16, 2016 02:17 PM UTC
While we click column 5 on Row 2 and then click column 1 (Expand/Collapse column) on Row 10, the current cell moves to column 5 on Row 10 and CurrentCellActivatedEventArgs shows 10 as the row index and 5 for the column index. This is the default behavior of SfDataGrid.
However, you can do the action if you only clicking a column 2 or 3 by wiring the PreviewMouseUp event like below,