Edit this page

Have mixed CLR and DLR properties

Using Common Language Runtime (CLR) properties together with the Dynamic Language Runtime (DLR) properties

When you have mixed CLR properties with dynamic properties in a dynamic object, you would have to include some additional logic to your implementation in order for the RadGridView to be able to work with your dynamic object.

For example if the CLR property is named "IsReadOnly", you should add code similar to:

public override bool TryGetMember(GetMemberBinder binder, out object result)
{
    if (binder.Name == "IsReadOnly")
    {
        result = this.IsReadOnly;
        return true;
    }

    if (this.dynamicFields.ContainsKey(binder.Name))
    {
        result = dynamicFields[binder.Name];
        return true;
    }
    else
    {
        result = null;
        return false;
    }
}

You can check the Various Data Sources demo for an example of binding to dynamic data.