Completed
Last Updated: 15 Apr 2016 10:26 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 15 Mar 2016 07:38
Category: GridView
Type: Bug Report
0
FIX. RadGridView - Excel-Like filtering does not work with enumeration
To reproduce:

public Form1()
{
    InitializeComponent();
    BindingList<Item> items = new BindingList<Item>();
    
    for (int i = 0; i < 30; i++)
    {
        if (i % 3 == 0)
        {
            items.Add(new Item(i,"Item" + i, IndeterminateBoolean.YesAndNo));
        }
        else if (i % 3 == 1)
        {
            items.Add(new Item(i, "Item" + i, IndeterminateBoolean.Yes));
        }
        else
        {
            items.Add(new Item(i, "Item" + i, IndeterminateBoolean.No));
        }
    }
    this.radGridView1.DataSource = items;
    this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    this.radGridView1.EnableFiltering = true; 
    this.radGridView1.ShowHeaderCellButtons = true;
    this.radGridView1.ShowFilteringRow = false; 
}

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

    public string Name { get; set; }

    public IndeterminateBoolean IsActive { get; set; }

    public Item(int id, string name, IndeterminateBoolean isActive)
    {
        this.Id = id;
        this.Name = name;
        this.IsActive = isActive;
    }
}

public enum IndeterminateBoolean
{
    No,
    Yes,
    YesAndNo
}

Workaround: use custom filtering http://docs.telerik.com/devtools/winforms/gridview/filtering/custom-filtering
Attached Files:
0 comments