Completed
Last Updated: 04 Oct 2016 08:22 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 24 Aug 2016 09:18
Category: GridView
Type: Bug Report
1
FIX. RadGridView - child rows values are displayed in the Excel-like filter popup if the columns of both templates have identical names
Please refer to the attached screenshot.

To reproduce:

public Form1()
{
    InitializeComponent(); 

    DataTable dt = new DataTable();
    dt.Columns.Add("Id", typeof(int));
    dt.Columns.Add("Name", typeof(string));

    for (int i = 0; i < 5; i++)
    {
        dt.Rows.Add(i, "Item" + i);
    }

    Random rand = new Random();
    DataTable dt2 = new DataTable();
    dt2.Columns.Add("Id", typeof(int));
    dt2.Columns.Add("Name2", typeof(string));
    dt2.Columns.Add("ParentId", typeof(int));
    for (int i = 0; i < 20; i++)
    {
        dt2.Rows.Add(i, "Child Item" + i, rand.Next(0, 5));
    }

    radGridView1.DataSource = dt;
    radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    GridViewTemplate template = new GridViewTemplate();
    template.DataSource = dt2;
    template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    radGridView1.MasterTemplate.Templates.Add(template);
    template.Columns["ParentId"].IsVisible = false;

    GridViewRelation relation = new GridViewRelation(radGridView1.MasterTemplate);
    relation.ChildTemplate = template;
    relation.RelationName = "MasterDetail";
    relation.ParentColumnNames.Add("Id");
    relation.ChildColumnNames.Add("ParentId");
    radGridView1.Relations.Add(relation);

    this.radGridView1.EnableFiltering = true;
    this.radGridView1.ShowFilteringRow = false;
    this.radGridView1.ShowHeaderCellButtons = true;
}

Workaround: change the Name property of the column in order to avoid duplicated columns: 

template.Columns["Name"].Name = "Name2";
Attached Files:
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments