DataGrid SelectedIndexChanged method not avaiolable in Compact Framework
-
This question was originally posted in the c# forum in error. I have an application running on a PDA (Windows Mobile 6.1)that currently uses the OnClick Event of a DataGrid to perform some functionality. I would like to have the same functionality run when the current row of my DataGrid is highlighted (by the user scrolling to it using the navigation button instead of tapping on it with the stylus). The method to use would seem to be OnSelectedIndexChanged but this does not seem to be available in the Compact Framework (3.5). The OnGotFocus doesn't seem to be suitable either (I guesss that this is because it applies to the DataGrid itself and not the row). Can anyone suggest how I can get this to work. Note that I only want the event to fire when the user moves to the row and not when the grid is being populated. Thanks
-
This question was originally posted in the c# forum in error. I have an application running on a PDA (Windows Mobile 6.1)that currently uses the OnClick Event of a DataGrid to perform some functionality. I would like to have the same functionality run when the current row of my DataGrid is highlighted (by the user scrolling to it using the navigation button instead of tapping on it with the stylus). The method to use would seem to be OnSelectedIndexChanged but this does not seem to be available in the Compact Framework (3.5). The OnGotFocus doesn't seem to be suitable either (I guesss that this is because it applies to the DataGrid itself and not the row). Can anyone suggest how I can get this to work. Note that I only want the event to fire when the user moves to the row and not when the grid is being populated. Thanks
You can use "CurrentCellChanged" event and in this event you can check the myGrid.CurrentCell.ColumnNumber or RowNumber and perform your task.