Solved

Datagridview reordering

Posted on 2014-01-13
2
385 Views
Last Modified: 2014-01-14
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,
0
Comment
Question by:jdcoburn
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39778275
Set the SortMode property of the columns to NotSortable instead of the default Automatic value.
0
 
LVL 16

Expert Comment

by:Imran Javed Zia
ID: 39778578
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
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now