How do you sort the data in datagrid?
Answer Posted / sunil
In a simple method,
DataSet ds = new DataSet();
// you must populate the dataset
DataTable dt = ds.tables[0];
DataView dv = new DataView(dt);
dv.Sort = dt.Columns[0];
// This will sort first column in ascending
dv.Sort = dt.Columns[0] + " DESC";
// This will sort first column in descending
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Explain how to create dynamic gridview?
What is a dynaset in access?
What is ole db query?
What is the difference between data reader and data adapter?
What are the data access namespaces in .NET?
Define data access layer?
What is row state?
What is the difference between connected and disconnected environment?
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?
What are the advantages using ado.net?
Which is the best method to get two values from the database?
Where is adodb dll located?
What are the objects of ado.net?
What are typed and untyped dataset?
What is execute reader in ado.net?