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
2325
Dynamically generating field layouts
posted

I am using 14.2 for my wpf project. I want to have a window with a xamDataGrid in it and have that window reusable.  I have 11 models.  The window will show a given models task(which is data that needs maintenance).  A model may have between 2 to 7 different data sources(derived from Linq to EntityFramework).  The user will choose from a dropdown which table/task to edit in the grid. 

Consistent behavior should be as follows:

  1. being allowed to identify those columns that are allowed edit
  2. the cell background of the editable cell should be a different color from the readonly cell.
  3. possibly, allow column hiding (collapsing).

So I understand I can create field layouts in XAML, however I am wondering if I can do the same thing in the code behind and have the behavior that is required? 

Another question is; how do I toggle between the different layouts when I change the data source?

Parents
No Data
Reply
  • 515
    posted

    Hello:

    I also have this issue, wherein I have several different slices of the data in different models and must display them in completely different column layouts.

    My intention was to create several views one for each data model and simply make the inactive ones collapsed or hidden depending on say a DataTrigger. I'm very interested in what will be your ultimate solution.

Children