0

I am developing a WPF application, The below two being the major modules

  1. The data is obtained from a service and there would be frequent updates after the initial startup.
  2. The grid controls which display the data has to be dynamically created based on a configuration.

Which design pattern would best suit this problem. MVVM pattern does not fit here.

Any suggestions?

Thanks,

frictionlesspulley
  • 11,070
  • 14
  • 66
  • 115
Shiva
  • 3
  • 1

1 Answers1

0

using this solution WPF MvvM DataGrid Dynamic Columns

you can create the columns in your VM and have MVVM bind to both the column definitions and the data for the datagrid.

This is assuming that you need a lot of control over your columns and not just have the datagrid auto generate them from your itemssource binding

Community
  • 1
  • 1
Anton
  • 7,709
  • 5
  • 31
  • 33
  • Thanks for the reply. In my scenario, the number of grid controls are going to be dynamic. The service needs atleast 30 seconds to get the data. The UI controls cannot be created until the service has obtained the data. Will MVVM still fit in? Thanks. – Shiva Dec 14 '11 at 04:26
  • What kind of "grid controls"? Also, would it be possible to fetch the configuration data, then only fetch a small amount of the overall data for the user to see? (This is assuming that the data is so large that it would not all fit on screen at once.) – Jake Berger Dec 14 '11 at 15:57
  • These are actually third party grid controls. Yes, It is a good idea to fetch only part of data and load it and then load other data at the back end. – Shiva Dec 19 '11 at 00:35