Single column sort in windows forms datagrid.

B

Brett P.

Hello,
I am trying to have only one column sortable within a
data grid. I know you set the allow sorting property to
true on the style, but this enables sorting for all
columns. Is there a way to override this implementation
so that only a few or one of the columns may be sorted?

thanks,
-brett
 
S

Scott M.

Instead of having the columns created for you at run-time, you'll need to
manually set up the columns at design-time.
 
B

Brett P.

I am setting up my columns at design time. How do I turn
off sorting for one single column? The allowsorting
property is on the table style, not on an individual
column.

thanks,
-brett
 
S

Scott M.

As you click on each column in the DataGrid's properties builder dialog, you
need to make sure that the "sort expression" box is cleared for columns you
don't want sortable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top