datagrid

  • Thread starter Thread starter Elrond Bishop
  • Start date Start date
E

Elrond Bishop

How Do I change the order and name of the columns in a datagrid that has
been bound to a collection object ?
 
You can use the TableStyles property of the DataGrid. In the designer
(Properties window) add a new TableStyle, and add the columns for that
TabelStyle. For each column you have to set the Mapping Name property
(equals to the property name of an item from your collection). The mapping
name for the TableStyle object should be set to the class name of the
collection you databind to. I use the following trick (in code):
VB.NET
TableStyle1.MappingName = myCollection.GetType.Name.ToString

C#
TableStyle1.MappingName = myCollection.GetType().Name.ToString()

Jan
http://weblogs.asp.net/jan
 
Back
Top