Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain how to create dynamic gridview?

929


What is a dynaset in access?

1027


What is ole db query?

933


What is the difference between data reader and data adapter?

978


What are the data access namespaces in .NET?

1154


Define data access layer?

916


What is row state?

934


What is the difference between connected and disconnected environment?

1032


How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?

933


What are the advantages using ado.net?

996


Which is the best method to get two values from the database?

932


Where is adodb dll located?

932


What are the objects of ado.net?

1030


What are typed and untyped dataset?

1064


What is execute reader in ado.net?

919