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
405
Multi-select combo column in ultragrid
posted

Hi,

I have an ultragrid that is bound to a binding list of objects. The object has a public property that is a list of another object.

Is there anyway for me to display that property in the grid as a column with a multi-select dropdown/combo displaying the property values.

I know the grid by default will set this public property as a child band, but can it be set to be displayed as a column with values being comma separated?

I am aware that ultragrid allows you to set the editor component of a column to an external control, but I was wondering if someone has done something like this before?

Since the grid is bound to the binding list and I'm using PetaPoco, if I can get the objects property to be bound to the column and update automatically, it will make saving the object much easier and simpler for me.

Thanks,

Karthik 

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Karthik,

    The WinGrid will always treat an IList or IBindingList property as a child band and there's no way to automatically make it display as a column.

    But what you could do is hide the child band and then add an unbound column to the parent band. Then, in the InitializeRow event of the grid, you could access the child rows and build whatever string you wanted and assign the value of the unbound column to a string that represents the child data.

    I'm assuming that you don't need to allow the user to edit the data in the child band. If you do, then you would have to somehow interpret the string in the unbojnd cell and then modify the child rows in code based on the new string.

Reply Children