robbie_62 Posted July 7, 2003 Posted July 7, 2003 hi there I use a datagrid to display data from my access db, I have fields such as first name surname address1 address2 address3 address4 home phone work phone mobile etc,etc I want to display this data in the order of the columns above but when i load the datagrid,it displays the columns in alphabetical order - eg address1 address2 address3 address4 first name home phone mobile work phone is there any way to stop the datagrid sorting my columns ??? Quote
JABE Posted July 7, 2003 Posted July 7, 2003 Specify the sorting order desired in your SQL using ORDER BY: SELECT ... FROM ... ORDER BY first name, surname, etc. Then set DataGrid.AllowSorting = False. Quote
*Experts* Nerseus Posted July 7, 2003 *Experts* Posted July 7, 2003 It sorts the columns? Do you have any special code to do this? If your SELECT lists out the columns in the order you want, the grid should "honor" that SELECT. As long as you have: SELECT first name, surname, address1, address2... and not SELECT address1, address2, address3, address4, first name... you should be Ok. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.