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

FilterDescriptor only filters on data load

5 Answers 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 12 May 2012, 03:57 PM
Hi everyone,

I really hope someone can help with this tricky issue. I have a gridview with a filterdescriptor to filter out any inactive contacts for a customer;

<telerik:RadGridView  ItemsSource="{Binding Customers_Contacts, Mode=OneWay}"...
                        <telerik:RadGridView.FilterDescriptors>
                            <telerik:FilterDescriptor Member="SafeInActive" IsCaseSensitive="True" Operator="IsEqualTo" Value="False" />
                        </telerik:RadGridView.FilterDescriptors>

This all seems to work fine when a change the datacontext to the customer, the list then filters the Customers_Contacts related entity list for the customer only showing active customers..

The problem I am having is whehn I set one of the contacts in the list to be inactive it is not filtered out of the list??

Any ideas?

Thanks

Mark

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 14 May 2012, 07:46 AM
Hello,

 As I understand you edit a single value in code behind and the filter is not applied.

If this is the case, then you should inform the GridView that the collection has changed. You may do this like so: 

myGridView.Items.EditItem(editedItem);
// change the value
 myGridView.Items.CommitEdit();

Please let me know how it works.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Marc Roussel
Top achievements
Rank 2
answered on 01 Dec 2013, 12:39 PM

I have the following code and still the grid isn't filtering.  Am I missing something ?


private void AddFilterDescriptor(string Member, FilterOperator Operator, object Value)
{
    rgvExpenses.FilterDescriptors.Clear();
    FilterDescriptor filter = new FilterDescriptor();
    filter.Member = Member;
    filter.Operator = Operator;
    filter.Value = Value;
    rgvExpenses.FilterDescriptors.Add(filter);
    rgvExpenses.Items.CommitEdit();
}


2013.3.1016.1050

0
Dimitrina
Telerik team
answered on 02 Dec 2013, 09:28 AM
Hi,

Would you please ensure there is a valid Member to filter on? Do you have all the records still presented after you executed the shared code?

As an additional note, you do not need to commit the edit unless you are already editing.

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Marc Roussel
Top achievements
Rank 2
answered on 02 Dec 2013, 12:21 PM
It's all right it works.  I was just not filtering enough columns to see the change.  Thank you
0
Dimitrina
Telerik team
answered on 02 Dec 2013, 03:26 PM
Hi,

I am glad to hear that.

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Oliver
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Marc Roussel
Top achievements
Rank 2
Share this question
or