Customize WPF DataGrid Filtering application for Prism-MEf

Apr 10, 2013 at 6:10 PM
Edited Apr 10, 2013 at 6:16 PM
Hi Prism Experts,
I tried several times, again and again to customize the code in this application http://jibgridwpf.codeplex.com/
to use it with my MVVM-Prism-MEF LOB application where my DataGrid reside in the view and its columns generated manually and its ItemsSource is observableCollection in ViewModel, ...

I added all classes into a folder called Filter in my Infrastructure layer to be available to all DataGrids in all Modules
The modifications i did are:
1-i added the code to the common / Infrastructure layer
2-i added ColumnFilterControl in my DataGridStyle.xaml file in DataGridColumnHeader and i use this
  style for all my grids so ColumnFilterControl  will appear automatically in column headers
3-i merged JibGrid.xaml code into my DataGridStyle.xaml so no DataGridStyle.xaml file any more
                 (note: i can't use JibGrid as it is in my application because i need to build my DataGrid manually
                  in the View and add CRUD processes in view model, ....)
4-i used JibGrid.xaml.cs as stand alone class which will be referenced in my View Model and the 
   View Model will delegate the requests to it then it will handle them as it did in the original
       application
i'm trying for days, but i couldn't get it running so please i need your help to customize this code as you did in many other
situations before.
Thanks in advance.
Developer
Apr 10, 2013 at 8:04 PM
Hi,

It would be useful if you could provide us with more information about what you are trying to achieve, so that we can have a better understanding of your scenario in order to help you with your concerns. Also, it would be useful to know with kind of problem you are experiencing (the application is not compiling, a style is not being applied, a module fails loading, etc.)

Regards,

Damian Cherubini
http://blogs.southworks.net/dcherubini
Apr 10, 2013 at 8:56 PM
Hi Damian,
After the above modifications the ColumnFilterControl appear in each column Header of my Grid but:
1-the images for filter operations doesn't show up in cbOperation combo box and distinct properties don't show up in cbDistinctProperties and Filter text
box not working.
2-i modified JibGrid to be stand alone class (no xaml code) but still inheriting from DataGrid class which will be referenced in the View Model which will delegate
requests to it. i need to now the new class structure
3-the interaction between the new JibGrid.cs class and ColumnFilterControl i can't figure out.

So if you allow me, what i need is to modify this application like this:
1-transform Jib.WPF.Controls project into Infrastucture module contains same items with the previous modifications
2-the project Jib.WPF.Testbed to be the MEFBootstrapper module with replacing MainWindow.xaml by MainView.xaml which will contain the data grid with
   its columns generated manually and no code behind and MainViewModel.cs which is the view model for the  MainView.xaml  and which will interact with the 
   view and Filtering classes
3-using MEF 
Note: the ItemsSource for DataGrid is ObservableCollection in the view model which is populated of data from database via services.

this way i can use this filter utility within MVVM, Prism rules and i can reuse it for any datagrid easily.
Sorry, if i'm asking too much but i tired really hard to apply the above modifications but i couldn't make it work, so i count very much on you.
Thanks.
Apr 11, 2013 at 5:38 PM
Hi Prism Experts,
Could you help me about this issue please?
Apr 11, 2013 at 7:42 PM
Hi Prism Experts,
Could you help me about this issue please?
Developer
Apr 11, 2013 at 8:01 PM
Hi,

What you are describing seems to be a really complex customization of the JibGrid control logic and for an specific scenario. Could you provide us with a sample solution of what you are trying to do that we can use as a starting point? This would allow us to analyze the customized code and help us give you feedback about it.

Thanks,

Damian Cherubini
http://blogs.southworks.net/dcherubini