Completed
Last Updated: 29 Oct 2015 08:33 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 30 Jan 2015 16:34
Category: GridView
Type: Bug Report
0
FIX. RadGridView - missing values in Excel-like filter popup after save/load layout
To reproduce: create a form with a button on it where on its Click event you show another form with the following code snippet:

public class Dummy
    {
        public int ID { get; set; }
        public string Description { get; set; }
    }

public Form1()
{
    InitializeComponent();
    this.radGridView1.FilterChanged += radGridView1_FilterChanged;

    if (File.Exists(@"..\..\..\layout.xml"))
    {
        this.radGridView1.LoadLayout(@"..\..\..\layout.xml");
    }
    else
    {
        radGridView1.Columns.Add(new GridViewTextBoxColumn { HeaderText = "Id ", FieldName = "ID" });
        radGridView1.Columns.Add(new GridViewTextBoxColumn { HeaderText = "Description", FieldName = "DESCRIPTION" });
    }
    radGridView1.EnableFiltering = true;
    radGridView1.MasterTemplate.ShowHeaderCellButtons = true;
    radGridView1.MasterTemplate.ShowFilteringRow = true;

    var items = new List<Dummy>();
    
    for (int i = 0; i < 20; i++)
    {
        var dummy = new Dummy
        {
            ID = i,
            Description = string.Format("Description_{0}", i)
        };
        
        items.Add(dummy);
    }
    radGridView1.AutoGenerateColumns = false;
    radGridView1.DataSource = items;
}

private void radGridView1_FilterChanged(object sender, GridViewCollectionChangedEventArgs e)
{
    this.radGridView1.SaveLayout(@"..\..\..\layout.xml");
}

Please refer to the attached gif file illustrating the steps.
Attached Files:
0 comments