views:

225

answers:

1

It seems to me I remember that my DataGrid was once able to take me to the first row of a sorted column with the text starting with the same letter as a pressed key, i.e. type 'k' and the cursor would be located at the row with 'Kenny' as the contents. I don't know if I've accidently disabled this property or am confusing this feature with my treeview which navigates this way already. Is there a property I've inadvertently disabled? Also, what is the official term for this feature?

A: 

I don't think there is a built in feature to do this in the DataGrid class. I have found that overriding the OnKeyDown or OnKeyPress of the Datagrid class can simulate this pretty easily.

`
class NavDataGrid : System.Windows.Forms.DataGrid { protected override void OnKeyDown(System.Windows.Forms.KeyEventArgs ke) { base.OnKeyDown(ke); //handle navigation here
} }

`

hipplar