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
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.
Hi Mike,
Thanks for the update. I figured the best way to handle this scenario would be to only display the selected values on the grid (and not allow users to edit).
The users will be able to select the values from the multi-select combo on the template.
This seems to be working fine, except for a small issue where the first time a user makes a change to the ultracomboeditor on the template, the value is not updated on the cell in the grid.
But if I check/uncheck another item or the same item again and then click on some other cell the value gets updated correctly.
I am using an ultracomboeditor control and have bound its Text property to the row edit template column.
(DataBindings) -> Text : uretScheduleVersion - Platform_Clearance