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

Filtering with a DataSourceControl

2 Answers 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
EBMS Stuart
Top achievements
Rank 1
EBMS Stuart asked on 29 Apr 2010, 06:43 PM
Hi guys,

I had a bit of a look in the forums, but I'm not really sure what to search for. I have a RadGrid connected to a custom DataSourceControl. When using filtering it retrieves EVERY record from the database, which is currently quite expensive as the data is coming across a remoting channel.

Is there anyway to get the radgrid to show the filter items, but to pass the resulting filter expression to my custom DataSourceControl to do the actual processing at the database end?

Any links related to this and/or to manual filtering with RadGrid would be helpful.

Thanks,

2 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 2
answered on 02 May 2010, 02:47 AM
Any ideas on this, I am having the same issue. Much appreciated :)
0
Veli
Telerik team
answered on 04 May 2010, 11:36 AM
Hi guys,

Here is a couple of links to get you started:

Help: Operating with the FilterExpression of RadGrid

Forum: Custom filter in conjunction with built-in filter

The general idea is to handle RadGrid's ItemCommand event when filter command is triggered. You cancel the command, get the filter expression and pass it to your custom data source, You can then rebind the grid:

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.FilterCommandName)
    {
        e.Canceled = true;
        //get e.Item.OwnerTableView.FilterExpression
        //apply filtering in your data source
 
        e.Item.OwnerTableView.Rebind();
    }
}


Kind regards,
Veli
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.
Tags
Grid
Asked by
EBMS Stuart
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 2
Veli
Telerik team
Share this question
or