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

[Solved] Problem in Adding the Filter Descriptor programmatically.

1 Answer 171 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hrushikesh
Top achievements
Rank 1
Hrushikesh asked on 21 Jan 2011, 06:35 PM
Hi,

I am using the doamin datasource with paging. when i apply the fieldfilter by selecting from each column and on filtering event of grid i am fetching the descriptor value an saving it on a string and also adding those to domaindatasource control to make the filter server side. i have that saved filter descriptor saved, no i want that filter descriptor to apply on the domain dataosurce and at the same time it indicate on the column that filter is applied.

i am suing this below code to add the filter descriptor

if ((issAppSettings.Contains("TestFilterSettings")))
                foreach (string fditem in issAppSettings["TestFilterSettings"].ToString().Split('~'))
                {
                    Telerik.Windows.Data.FilterDescriptor descriptor = new Telerik.Windows.Data.FilterDescriptor();
                    descriptor.Member = fditem.Split('|')[0];
                    descriptor.Value = fditem.Split('|')[1];
                    descriptor.Operator = (Telerik.Windows.Data.FilterOperator)Enum.Parse(typeof(Telerik.Windows.Data.FilterOperator), fditem.Split('|')[2].ToString(), true);
                    //this.grdList.FilterDescriptors.Add(descriptor);
  
                    ColumnFilterDescriptor countryColumnFilter = new ColumnFilterDescriptor((Telerik.Windows.Data.IDataFieldDescriptor)this.grdList.Columns[fditem.Split('|')[0]]);
                    countryColumnFilter.FieldFilter.FilterDescriptors.Add(descriptor);
  
                    this.grdList.FilterDescriptors.Add(countryColumnFilter);
                      
                }


That is doing the filter but not at server side but at the client side.

Please suggest.
Thank you
Hrushikesh

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 24 Jan 2011, 07:39 AM
Hello,

 You need to assign the same filter to the domain data source if you want server-side filtering. 

Regards,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Hrushikesh
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or