Completed
Last Updated: 07 Apr 2016 10:20 by ADMIN
ADMIN
Dimitar
Created on: 22 Mar 2016 07:08
Category: GridView
Type: Bug Report
0
FIX. RadGridView - exception when the grid is bound to an array of different objects.
To reproduce:
public abstract class Base
{
    public abstract string Name { get; }
}

public class Child : Base
{
    public override string Name
    {
        get { return "Child"; }
    }
}

public class Child2 : Base
{
    public override string Name
    {
        get { return "Child2"; }
    }
}

public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    public RadForm1()
    {
        InitializeComponent();

        var list = new List<Base>();
        list.Add(new Child());
        list.Add(new Child());
        list.Add(new Child2());

        radGridView1.DataSource = list.ToArray();
    }
}

Workaround:
 radGridView1.DataSource = list;
0 comments