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
Which is faster sqldataadapter and sqldatareader?
What are the benefits of ADO.NET?
What are the main differences between classic ado and ado.net?
What is the difference between statement and preparedstatement interface?
describe the dataset object in ado.net.
What is the use of SqlCommandBuilder?
What is two way data binding android?
What is dbcontext and dbset in entity framework?
Is it possible to edit data in Repeater control?
List the 4 common ado.net namespaces?
What are the benefits of using of ADO.NET in .NET 4.0?
Explain how to copy the contents from one table to another table and how to delete the source table in ado.net?
What are the objects of ado.net?
Data reader read and forward only, how is it possible to get 2 tables of data at a time?
What is ado.net and its features?