Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ordering in a DataGrid

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I'm new to C#/.NET programming.
I come from a Delphi background.
I'm making use of DataTable / DataView / DataGrid components.
The nice thing that I have noticed is the ability to set the ordering of the data (in the grid) on the fly - by clicking the title bar of the column in question.
Albeit that this is a nice touch - how do I turn this ability off so that I prevent the user from re-ordering the data as I intended it to be viewed.

It's probably a simple property I'm missing.
Is anyone able to point me in the right direction on this one ?

Thanks in advance.

Steve
 
In the properties builder you can manually set each column as sortable or not.
Or you can just leave off the Sort Command Event Handler:
private void DataGrid_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top