Link to home
Start Free TrialLog in
Avatar of jdcoburn
jdcoburn

asked on

Datagridview reordering

hi - I'm working with a datagridview control. I would like to disable the feature that allows the user to click on the header bar and the respective column is reordered (one click orders ascending, the next click orders descending.) at best this is confusing in the context of the application, and it might be reordering values as they are read back in to my permanent storage, since it only reorders a single column, not the entire row.
thanks,
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Imran Javed Zia
Hi,

if you want to disable sorting for a specific column then you can use SortExpression="" like following:

<asp:BoundField HeaderText="Header Name" DataField="FieldName" SortExpression="" />


and for complete grid you can use allowsorting="false"  as following:

<asp:gridview id="gv"
        allowsorting="false"
        runat="server">

Thanks