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
250
xamGrid Dynamic GroupColumns
posted

Hi,

Need some help in creating GroupColumns dynamically in xamGrid (11.2 WPF). I could have done this in code behind, but I need to achieve it in a pure MVVM fashion by writing smart xaml. Would appreciate if you may help me out with some sample code.

Here is a scenario to understand the requirement:

Let's say I have a person entity which has few attributes and I am getting multiple person entities from database. Now I would like to show each person in a groupColumn and under that show the attributes associated to it. Something like this:

      Person 1                          Person 2                         Person 3

Name   Address            Name     Address             Name   Address

  • 4475
    posted

    Hello,

     

    I am just checking your progress on the issue.

     

    If you require any further assistance please do not hesitate to ask.

     

    Sincerely,

    Ekaterina

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

  • 4475
    posted

    Hello,

     

    I have been investigating into your issue and in order to give you an adequate custom approach, I need some additional information.

     

    I assume that you have tried to directly bind the Columns collection to a property in your view model, in order to manipulate the columns there, however currently you cannot do this as the Columns property is not a DependencyProperty and the XamGrid does not expose any other approach for you to this.

     

    This being said, we can probably think of dozens of different  approaches, all implemented in MVVM fashion. However they all depend on the specific aspects of your MVVM architecture - how exactly are you structuring your code, how have you implemented the pattern, how have you organized you code, how and where do you prefer to place the functionality  that will handle the task. If you decide to expose your grid to the code behind, you will be able to manage your columns collection. However the way this implementation will be done, is again up to you, depending on the specific aspects of your project and your personal preferences.

     

    Since the Developers Support is giving advises according to our controls functionality and behavior, what I can do for you is to show you how to implement a certain scenario related to the functionality of certain feature  – for example how to get the columns collection from the code behind, how to add or subtract columns or other similar operations. In case you need some advice or how to organize you project as general and where to put the functionality that I can give you, I can suggest you to contact our Consulting Department on sales@infragistics.com. This teams task is to find the best strategy to construct your project, optimize it and so on.

     

    I will be looking forward to hearing from you.

     

     

    Sincerely,

    Ekaterina

    Developer Support Engineer

    Infragistics Inc.

    www.infragistics.com/support