Say I have a bunch of objects of type Foo and I create a System.Data.DataTable where I add a couple columns like:
// START CODE SNIPPET
// and then add a few rows:
for ( int i=0; i < 50; i++ )
for ( int j=0; j < table.Columns.Count; j++ )
Foo foo = new Foo();
foo.SomeProperty = rand.Next().ToString();
table.Rows[i][j] = field;
// now assign the datasource
gridGroupingControl1.DataSource = table;
//END CODE SNIPPET
the problem is that I get jillions of exceptions thrown like this:
catched at Syncfusion.Grouping.FieldDescriptor.GetValue(Record record) in :line 0
How can I handle the processing myself so that I can tell it how to display a Foo in a cell (assume that there is some processing I need to do for each Foo such as call a custom method or perform some string manipulation)...
Thanks - Daniel
ADAdministrator Syncfusion Team July 14, 2004 09:26 AM
I created a sample for the scenario you described and I found a bug in the FieldDescriptor class. I have that fixed now. If you submit a direct-trac incident we can send you a private patch.
With that fix you can display custom types. Just make sure not to use public field in that type. Instead use public properties. I attached the sample form I created.
With the fix, you can then add columns to the table descriptor in the form "ColumnName.PropertyName".
DCDaniel ChaitJuly 14, 2004 11:32 AM
thanks - I created an incident (#12397) for this. - daniel