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!

DataGrid Sorting

Status
Not open for further replies.

Shosh

IS-IT--Management
Mar 19, 2004
11
CA
Hi everyone,
I was wondering if someone can help me with this.
How can I sort a datagrid?
I have a fully working datagrid that is connected to an sql database (dev). all the data shows in the right place as i want it.
I have sorting to be true in the datagrid. But when I click on the header on the top nothing really happens.
I did an event handler but this is where my problem start I have no idea what to put there or what is the best why of doing that.

Thank you very much
Assaf
 
Set the AllowSorting property to true.
You can do that in the Property window when you add the DataGrid control to the host form or programmatically :
m_DataGrid.AllowSorting = true;
There are others ways depending on how you bind the datagrid.
-obislavu-

 
Did u add the event handler in ur initialize component ()? May be that shall help u .

yujwal
 
Thanks a lot people i have solved it!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top