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

How to use custom filter in RadGrid?

1 Answer 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fernando
Top achievements
Rank 1
Fernando asked on 27 Jul 2012, 12:13 PM
How to use custom filter in RadGrid, not allowing the grid to make its internal filters after you tell him the DataSource for the data entered is already filtered.

Fernando.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 30 Jul 2012, 01:31 PM
Hi Fernando,

Generally, you could use the ItemCommand event to cancel the actual filtering on given condition:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.FilterCommandName)
    {
        Pair arguments = e.CommandArgument as Pair;
        string function = arguments.First.ToString();
        string field = arguments.Second.ToString();
        string value = ((e.Item as GridFilteringItem)[field] as GridTableCell).Column.CurrentFilterValue;
 
        if (true)
        {
            e.Canceled = true;
        }
    }
}

I hope this will prove helpful.

Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Fernando
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or