This is a migrated thread and some comments may be shown as answers.

Customizing Complex Filter

2 Answers 150 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Claude IMBERT
Top achievements
Rank 1
Claude IMBERT asked on 20 Apr 2010, 09:25 AM
Hi Telerik Team,

In a datagridview, I have filters enabled on columns.
I would like to customize the Complex filter with my own skin.
You can see my explanation in the 2 attachments.

Regards,

2 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 20 Apr 2010, 04:51 PM
Hi Claude IMBERT,

You have to create your custom theme by using the Visual Style Builder. Then you should replace the default filter cell with a custom one that overrides the CreateCompositeFilterForm method. Please consider the code snippet below:

void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
    if (e.CellType == typeof(GridFilterCellElement))
    {
        e.CellType = typeof(MyFilterCell);
    }
}
 
public class MyFilterCell : GridFilterCellElement
{
    public MyFilterCell(GridViewDataColumn column, GridRowElement row)
        : base(column, row)
    {
    }
 
    protected override Type ThemeEffectiveType
    {
        get { return typeof(GridFilterCellElement); }
    }
 
    protected override CompositeFilterForm CreateCompositeFilterForm()
    {
        CompositeFilterForm form = base.CreateCompositeFilterForm();
        form.ThemeName = "Aqua";
        ThemeResolutionService.ApplyThemeToControlTree(form, "Aqua");
        return form;
    }
}


Should you have any other questions, don't hesitate to ask.

Best wishes,
Jack
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Claude IMBERT
Top achievements
Rank 1
answered on 21 Apr 2010, 10:36 AM
Hi,

It has solved my problem. Your solution works fine.

Best Regards
Tags
GridView
Asked by
Claude IMBERT
Top achievements
Rank 1
Answers by
Jack
Telerik team
Claude IMBERT
Top achievements
Rank 1
Share this question
or