Reputation: 41
I'm using 4.7 .NetFramework. I'm Trying to Press F3 on DataGridView Control and it takes as Sorting GridData. So i want to disable this Key.
Upvotes: 0
Views: 811
Reputation: 191
You have to create your own customized datagridview.
class MyDataGridView:DataGridView
{
protected override void OnKeyDown(KeyEventArgs e)
{
//Here you have to manage what you want to do with the keys.
}
}
Upvotes: 0
Reputation: 1413
The sort mode for each text box column is specified through the SortMode
property of the column. By default is set to Automatic
. That why press F3 worked. Set SortMode
property to NotSortable
value.
dataGridView.Columns["ColumnName"].SortMode = DataGridViewColumnSortMode.NotSortable;
More information look at DataGridViewColumnSortMode and article.
Upvotes: 1