dataGrid SelectedIndexChanged Method not available in Compact Framework
-
I have an application running on a PDA that currently uses the OnClick Event of a DataGrid to perfortm some functionality. I would like to have the same functionality run when the current row of my DataGrid is highlighted (by the user scrolling ro it instead of clicking on it). The method to use would seem to be OnSelectedIndexChanged but this does not seem to be available in the Compact Framework (3.5). I 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 populated. Thanks
-
I have an application running on a PDA that currently uses the OnClick Event of a DataGrid to perfortm some functionality. I would like to have the same functionality run when the current row of my DataGrid is highlighted (by the user scrolling ro it instead of clicking on it). The method to use would seem to be OnSelectedIndexChanged but this does not seem to be available in the Compact Framework (3.5). I 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 populated. Thanks
Just use the Mouse or Click Events exposed by the datagrid. and get its CurrentRowIndex. You may have to bind the datagrid datasource using the CurrencyManager. Then just build a DataRowView from it. I'm not sure if this is what you are asking. BTW. you should post this in Mobile Development. Regards M Curley. :)
-
Just use the Mouse or Click Events exposed by the datagrid. and get its CurrentRowIndex. You may have to bind the datagrid datasource using the CurrencyManager. Then just build a DataRowView from it. I'm not sure if this is what you are asking. BTW. you should post this in Mobile Development. Regards M Curley. :)
The problem is that I will not be clicking on the grid so the onClick event won't fire. I will just be using the button thing at the bottom of the PDA ro scroll down the list. I was looking for an event that would fire when the row was highlighted. The SelectedIndexChanged looked like the one for me but that doesn't seem to be available in the Compact Framework. I will post this again on the Mobile Development board and make my question a bit clearer. Thanks for your reply anyway.
-
The problem is that I will not be clicking on the grid so the onClick event won't fire. I will just be using the button thing at the bottom of the PDA ro scroll down the list. I was looking for an event that would fire when the row was highlighted. The SelectedIndexChanged looked like the one for me but that doesn't seem to be available in the Compact Framework. I will post this again on the Mobile Development board and make my question a bit clearer. Thanks for your reply anyway.
Create an integer variable. Then load the datagrid and select the first row by using
dataGrid.Select(0)
Then capture the up and down keys on the form and increment or decrement this variable and pass this to the dataGrid
dataGrid.Select(your_variable_here)
Would this not achieve what you want to do?
Regards Mick Curley :)