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
How to work with disconnected data - the dataset and sqldataadapter?
What is method to get XML and schema from Dataset? getXML() and get Schema ()
Which is the feature of ado.net?
List the 4 common ado.net namespaces?
What is microsoft ado.net?
What is the difference between Optimistic and Pessimistic locking?
What connected data?
What are good ado.net object to replace to ado recordset object.
What is the difference between Datareader and Dataset?
List all the steps in order, to access a database through ado.net?
Why edit is not possible in repeater?
What are advantages of microsoft-provided data provider classes in ado.net?
differance between ADO vs ADO.Net?
What are the different methods by which we can populate a dataset?
Can we create Synonymns in MS Acess,My Sql Server,Sql Server? But iam we can create in oracle!