nuritat
asked on
GridView sort only to specified fields
Hi,
When I turn allow sorting to true, I get sort to all fields,
how can I make the sort option onlt to some fields and to others not?
When I turn allow sorting to true, I get sort to all fields,
how can I make the sort option onlt to some fields and to others not?
By setting the DataGridViewColumn.SortMod e property you can disable the ability for the user to sort on the given column. You can use Visual Studio to set this property by right-clicking on the DataGridView and choosing the Edit Columns option. Next select the column that you want to disable sorting for and set the SortMode property to NotSortable.
ASKER
Thats what I was looking for, but unfortunatly I have only "SortExpression" element in property list and not sortMode
Above link contains solution for datagridview
dgvCol.SortMode = DataGridViewColumnSortMode .NotSortab le
Change it accordingly for Gridview.
dgvCol.SortMode = DataGridViewColumnSortMode
Change it accordingly for Gridview.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
perfect solution for gridview that doesn't have SortModa as property
thanks!!
thanks!!