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
20
xamGrid TemplateColumn FilterEditorTemplate when rows have comboboxes with varying ItemsSources
posted

Hi,

I need a FilterEditorTemplate (and FilterItemTemplate) for a TemplateColumn that will filter (via Contains operator) the rows of the grid where the ItemTemplate shows a simple TextBlock and the EditorTemplate has a combobox whose ItemsSources vary from row to row.

I know I could do this if I had access to the whole list of possible options that this column could contain, but the reason why each row has a restricted list of values for each combobox is because it would require loading masses more data (10x+) than what the rest of the grid would normally hold! Hence the use of multibinding to set the ItemsSource's depending on another parameter. The converters and multibinding work fine.

The problem is that I don't know the underlying filter system very well and there are very few example that even come close to the issue I have here.

I have attached the TemplateColumn's xaml so that might help.

Any help would be very much appreciated as this is the final part I need to complete for this module.

Thanks,

Alex

FilterRequired.rar
Parents
  • 22015
    posted

    Hello Alex,

     

    Thank you for your post.

     

    I have been looking into it and have created a small sample application for you. In the sample application I have a simple xamGrid with a TemplateColumn. In the TemplateColumn I have a ComboBox and it has different ItemsSource for each row. Then I have created a FilterItemTemplate and FilterEditorTemplate. In the FilterEditorTemplate I am setting the ItemsSource of the ComboBox to show all of the items in the sources for all of the ComboBoxes. Then I am setting the SelectedValue property of the Combo to bind to the value of the FilteringDataContext.

     

    Please find the attached sample application and feel free to let me know if you have any further questions on this matter.

    Grid_TemplateColumnWithComboFilter.zip
Reply Children
No Data