Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
xamGrid in-built filter extracting the multlple values selected
posted

Hi,

i am using the  xamGrid v12.2 for silverlight ... while making use of the in-built filter options using the filter menu, i am not able to get the multiple values that have been selected   for that column. the e.FilterValue always shows the last option selected in that column.

Parents
  • 34430
    Verified Answer
    Offline posted

    Hello san kam,

    Thank you for your post!

    Your mentioning of e.FilterValue leads me to believe that you are utilizing the XamGrid.Filtering event in your project. This will always reflect the most recently selected value in the filter for that column, as the e.FilterValue is not a collection, but a single value. Instead of using e.FilterValue, I would recommend that you look into the e.RowFiltersCollection. This collection contains RowsFilter objects which represent all of the filters applied to your grid. Each of these RowsFilter objects have a Conditions collection, which contain ComparisonCondition objects. Each of these ComparisonCondition objects has a FilterValue property, which you can check to retrieve your selected filter menu filters. One thing to note is that you will want to place the calls to e.RowFiltersCollection inside of a Dispatcher.BeginInvoke(new Action(() => { your code here...})). The reason for this is because when the XamGrid.Filtering event is called, this collection is populated with a RowsFilter object, but that RowsFilter does not have anything in its Conditions collection yet.

    As an alternative to handling the XamGrid.Filtering event, you may also want to consider utilizing the XamGrid.Filtered event. By this time, the RowFiltersCollection will be fully populated, and you can access your RowFiltersCollection from the XamGrid at any time by using myXamGrid.FilteringSettings.RowFiltersCollection.

    I have attached a sample project to demonstrate the above. I hope this helps you.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XamGridFilterOptionsCase.zip
Reply Children