Reputation: 19
I have a MSSQL DB, with lot of records. I have a column in my table with serial number (Auto generated). I am populating the DB in grid-view (C#), I want to sort the gridview based on this serial number column while the gridview loads.
Upvotes: 0
Views: 55
Reputation: 351
Well why don't you pass already sorted data to gridview.just use order by clause in your sql query and pass the query results to gridview which will be already sorted.
select * from tablename order by SerialNumber(Sql syntax)
About the second solution u can use dataview class to sort data before passing to gridview
Upvotes: 1