Completed
Last Updated: 12 Jun 2014 19:35 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 04 Jun 2014 08:05
Category: GridView
Type: Bug Report
1
FIX. RadGridView - NullReferenceException when expanding rows in Self-reference hierarchy
To reproduce:

public Form1()
{
    InitializeComponent();
    
    radGridView1.Columns.Add("Id");
    radGridView1.Columns.Add("ParentID");
    radGridView1.Columns.Add("Name");

    radGridView1.Relations.AddSelfReference(radGridView1.MasterTemplate, "Id", "ParentID");

    for (int id = 1; id <= 3; id++)
    {
        radGridView1.MasterTemplate.Rows.Add(id, 0, "Node_" + id);
        for (int iChild = 1; iChild <= 5; iChild++)
        {
            int childId = id * 100 + iChild;
            radGridView1.MasterTemplate.Rows.Add(childId, id, "ChildNode_" + childId);
        }
    }
    foreach (GridViewHierarchyRowInfo row in this.radGridView1.Rows)
    {
       row.IsExpanded = true;
    }
}
0 comments