I’m using a generic item wrapper defined as below:
public class ItemWrapper
{
public State State { get; set; }
public string Message { get; set; }
public object Item { get; set; }
}
public enum State
{
Ok,
Warning,
Error
}
The ItemWrapper could contain objects from different classes in the Item property; for instance:
ItemWrapper wrapper = new ItemWrapper();
wrapper.Item = new Company() {Id = "Acme", Desc="Acme company" };
The point is how to bind RadGridView columns to show both ItemWrapper columns (State and Message) and wrapped object columns ( Company.Id and Company.Desc).
Binding ItemWrapper properties is ok while the expected way for Company should be:
col.DataMemberBinding = new Binding("Item.Id");
col.DataType = typeof(string);
that seems, at least, to work but raising lot of exceptions:
A first chance exception of type 'System.ArgumentException' occurred in Telerik.Windows.Data.dll
that slow down rows loading to several second for few items (making control unusable) .
Sincerely