ComponentOne True DBGrid for WinForms
True DBGrid for WinForms Task-Based Help / Controlling Grid Interaction / Disabling Column Sorting
In This Topic
    Disabling Column Sorting
    In This Topic

    To disable column sorting, set the AllowSort property to False. This property can be set either in the designer or in code.

    In the Designer

    Locate the AllowSort property in the Properties window and set it to False.

    In Code

    Add the following code to the Form_Load event to set the AllowSort property to False.

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1TrueDBGrid1.AllowSort = False
    

    To write code in C#

    C#
    Copy Code
    this.c1TrueDBGrid1.AllowSort = false;
    

    What You've Accomplished

    Clicking on the First column does not sort the column: