By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,895 Members | 1,106 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,895 IT Pros & Developers. It's quick & easy.

How can I disable sorting in a DatagridView?

P: n/a
Hello, Programmers.

How can I disable sorting in a DatagridView?

Thanks in advance.
Jul 10 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 10 jul, 11:06, Bruno Neves Pires Silva <brunonpsi...@gmail.com>
wrote:
Hello, Programmers.

How can I disable sorting in a DatagridView?

Thanks in advance.
I have found out:
by the property sortmode of each column.
Thanx.
Jul 10 '08 #2

P: n/a
On each column, set the SortMode to NotSortable or Programmatic; either via
the IDE, or via a simple loop:

foreach (DataGridViewColumn column in grid.Columns)
{
column.SortMode = DataGridViewColumnSortMode.NotSortable;
}

Marc
Jul 10 '08 #3

P: n/a
Hows this:

DataGridView gridView;
foreach (DataGridViewColumn column in gridView.Columns)
{
column.SortMode= DataGridViewColumnSortMode.NotSortable;
}

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Bruno Neves Pires Silva" wrote:
Hello, Programmers.

How can I disable sorting in a DatagridView?

Thanks in advance.
Jul 10 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.