You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I want know how to adjust the order of datagridview's columns at run time. since when i bound the grid with data source it randomly sort the columns but i want them like the table in the database.
Add the sort criteria to the query that retrieves the data. Or you can specify a sort value in the DefaultView of the dataset table if you are using a dataset.