Completed
Last Updated: 17 Aug 2015 10:06 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 15 Jun 2015 06:56
Category: GridView
Type: Bug Report
0
FIX. RadGridView - grid rows disappear when custom filtering is applied and you have grouped by a column
To reproduce:
private RadGridView radGridView1;

public Form1()
{
    InitializeComponent();
    radGridView1 = new RadGridView() { Dock = DockStyle.Fill };
    Controls.Add(radGridView1);

    List<Item> items = new List<Item>();
    for (int i = 0; i < 10; i++)
    {
        items.Add(new Item(i, "Item" + i, DateTime.Now.AddDays(i)));
    }
    radGridView1.AutoGenerateColumns = true;
    this.radGridView1.DataSource = items;
    this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    this.radGridView1.EnableFiltering = true;

    this.radGridView1.CustomFiltering += radGridView1_CustomFiltering;
    radGridView1.EnableCustomFiltering = true;
}

void radGridView1_CustomFiltering(object sender, GridViewCustomFilteringEventArgs e)
{
    e.Handled = false;
    e.Visible = true;

    var item = (Item)e.Row.DataBoundItem;

    if (item == null)
        return;

    if (item.Name.EndsWith("Item"))
    {
        e.Handled = true;
        e.Visible = false;
    }
}

public class Item
{
    public int Id { get; set; }

    public string Name { get; set; }

    public Nullable<DateTime> Date { get; set; }

    public Item(int id, string name, Nullable<DateTime> date)
    {
        this.Id = id;
        this.Name = name;
        this.Date = date;
    }
}


Workaround:

private void radGridView1_CellEndEdit(object sender, GridViewCellEventArgs e)
{
    this.radGridView1.MasterTemplate.Refresh();
}
Attached Files:
0 comments