DataBinding to custom object

Hi,

we are using a GGC which is bound to a custom object. The custom object implement IBindingList.

So for example we have the follwing object:

public class MyTable: BindingList, ITypedList
{

}

so the corresponding "MyRow" class looks something similar like this:

public class MyRow
{
string Name
{
get;
set;
}

CustomObject Data
{
get;
set;
}
}

So the problem occurs for the "Data" property because this is not a native type.

The CustomObject class looks something similar like this:

public class CustomObject
{
private double myValue;

public string StringValue
{
get;
set;
}
}

So in the binding we set for the mapping name (for the column) "Data_StringValue" now the StringValue appears in the cell. How can I get the parent property for the field "Data_StringValue". I can only get the parent FieldDescriptor with GetParentFieldDescriptor - but I want the parent property so "Data" instead of "Data_StringValue".

Thanks,
Tom



1 Reply

HA haneefm Syncfusion Team April 24, 2007 05:47 PM UTC

Hi Tom,

If you want to hide the inner most property field of the custom object then set the Engine.ShowNestedPropertiesFields to false. Here is a code snippet

this.gridGroupingControl1.Engine.ShowNestedPropertiesFields = false;

Best regards,
Haneef

Loader.
Up arrow icon