Thanks, this seems to work just fine, there is one drawback though, now all
my properties are exposed to the grid and the columnheaders show the propety
names as they were set in the class. What would be the best way to
customize the visible columns and their headers without altering the
underlying value object classes?
Greetings,
Guy
> Hi Guy,
>
[quoted text clipped - 37 lines]
> >
> > Guy
ClayB [Syncfusion] - 03 Oct 2004 10:23 GMT
To control the columns and their order in the DataGrid, you can add a
DataGridTableStyle to the DataGrid's TableStyles collection. In this
tablestyle, add columnstyles to the tablestyle1.GridColumnStyles for each
column you want to see. Here is a FAQ discussing this process for a
DataTable, but it will also work for other datasources.
How can I programatically add and remove columns in my DataGrid without
modifying the DataTable datasource?
http://www.syncfusion.com/faq/winforms/search/1070.asp
One point to note is the MappingName you assign to the tablestyle is
crucial. If it in not the proper value, the grid will not use the
tablestyle. Here is a FAQ that has a method that you can use to determine
the string you must use for the MappingName.
How do I determine the DataGridTableStyle MappingName that should used
for a DataGrid to make sure the grid uses my tablestyle ?
http://www.syncfusion.com/faq/winforms/search/931.asp
=============================================
Clay Burch, .NET MVP
Syncfusion, Inc.
visit http://www.syncfusion.com for .NET Essentials
> Thanks, this seems to work just fine, there is one drawback though, now
> all
[quoted text clipped - 59 lines]
>> >
>> > Guy