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
650
Bind ViewModel Business Objects to UltraGrid
posted

I have classes such as Address & Client which hold properties. 

I have created a ViewModel like so:

public class MyViewModel
{

    public Address MyAddressObj {get;set;}

    public Client MyClientObj {get;set;}

}

Can I bind MyViewModel to the Grid and show the properties of the Address & Client classes. I have already tried and it just creates columns called MyAddressOb & MyClientObj.  I would like to specify what properties of the classes are displayed in the grid if possible via code.

Parents
  • 469350
    Offline posted

    If you want to hide columns in the grid, the best thing to do is to handle the InitializeLayout event and set the hidden property on the columns.

    Another option would be to apply the Browsable(false) attribute the properties that you want to hide from DataBinding.

Reply Children