Articles in this section
Category / Section

How do I prevent sorting by columns?

1 min read

While clicking on the column header, the Grid control get sorted automatically. To avoid this in GridGroupingControl the AllowSortColumns property has to be set as 'false', in GridDataBoundGrid the SortBehaviour property has to be set as 'None'. Please refer the below code snippets for both GridGroupingControl and GridDataBoundGrid:

GridGroupingControl:

C#

this.gridGroupingControl1.TableOptions.AllowSortColumns = false;

GridDataBoundGrid:

C#

this.gridDataBoundGrid1.SortBehavior = GridSortBehavior.None;

GridGroupingControl:

VB

Me.gridGroupingControl1.TableOptions.AllowSortColumns = False

GridDataBoundGrid:

VB

Me.gridDataBoundGrid1.SortBehavior = GridSortBehavior.None

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied