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

Filter in radgrid control server side

3 Answers 802 Views
Grid
This is a migrated thread and some comments may be shown as answers.
pankaj
Top achievements
Rank 1
pankaj asked on 30 Sep 2008, 10:56 AM
Hi,

 I have bind the data in the grid from the

rgStaffPhysicianDetails.DataSource = GetPhysicianDetail();

in the server side code. So please give me the details of how the apply the filtering with the use selected filter criteria and value get from the filter textbox in the radgrid control.

protected void RadGrid1_PreRender(object sender, System.EventArgs e)
{
 
if (!Page.IsPostBack)
 {
   RadGrid1.MasterTableView.FilterExpression =
"([Country] LIKE \'%Germany%\') ";
   GridColumn column = RadGrid1.MasterTableView.GetColumnSafe(
"Country");
   column.CurrentFilterFunction = GridKnownFunction.Contains;
   column.CurrentFilterValue =
"Germany";
   RadGrid1.MasterTableView.Rebind();
 }
}

Here in this code filteration is server side but selection criteria is fixed,
 
so i need to set the selection criteria with use of the radgrid control selection criteria( like contains, not contains, NotFilter, StartWith, EndWith etc. ) any of the filter dropdownlist and filter value from the filter textbox in the radgrid control.

 So, i have problem how to get the selected value from the filter dowpdownlist and filtered value from the filter Textbox of radgrid control, Kindly help me as soon as possible.
 


Thanks
Pankaj Tyagi

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 02 Oct 2008, 01:45 PM
Hi pankaj,

One similar implementation is shown in the following example.
I hope it gets you started properly.

Kind regards,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
madhavi
Top achievements
Rank 1
answered on 28 Jan 2015, 11:34 AM
I have similar problem. my radgrid is dynamically created and it has filtering type combining so both checklist filtering and filter menu

so how can I get selected values in checklist filtering?

Thanks,

Madhavi 
0
Angel Petrov
Telerik team
answered on 02 Feb 2015, 08:52 AM
Hi Madhavi,

When the combined filter is used you can extract the filter values from the FilterExpression property of the MasterTableView. That one ensures that you will always get the filter applied to the grid as there are cases in which the filter checklist is not populated.

If the above suggestion does not prove helpful please share with us the page code alongside with e detail explanation of the scenario, so we examine it and if possible provide an alternative solution.

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
pankaj
Top achievements
Rank 1
Answers by
Yavor
Telerik team
madhavi
Top achievements
Rank 1
Angel Petrov
Telerik team
Share this question
or