Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Initial sort column in DataGridView
Message
 
À
25/10/2006 14:41:42
Rick Forbes
Brotherhood of Maintenance of Way Employ
Royal Oak, Michigan, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01164508
Message ID:
01165189
Vues:
14
Rick,

>I would like to display the "OakLeaf.MM.Main.Windows.Forms.mmDataGrid" with an initial sort column selected. Could anyone please tell me how to do this. I know it can be done because it is done in the mmpicker control.

You can bind the grid to a DataView and sort the DataView. Check out the MM .NET Dev Guide topic "Working with DataViews". If you look at the source code for mmPickListSearch, you'll see the "magic" code that sets the Sort property of the Default data view:
// Set the default sort column if a default sort column is specified
if (pickListParams.GridDefaultSortColumn != null && 
	!mmString.Empty(pickListParams.GridDefaultSortColumn.BindingSourceMember))
{
	dsResultSet.Tables[0].DefaultView.Sort = 
		pickListParams.GridDefaultSortColumn.BindingSourceMember + " ASC";
}
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform