I have a requirement to use a dropdown checkbox list in a grid. Each cell in this column should display the concatenation of the 'name' field of the checked items in its list.
I have done this before with a good deal of tinkering--see the post "Adding Checkbox List As Dropdown From Text Editor In Grid Cell", towards the bottom.
However, now I have available the new Infragistics CheckedListSettings, and am wondering: what is considered the 'best practice' for creating and using DataSources for an UltraCombo editor control set as a checkbox list that is assigned to a grid column? What is the easiest way to use this functionality? Anything to streamline the current approach (which is onerous) would be helpful.
Thanks,
J
Hi J,
Sorry, it looks like there was a typo in my previous post. I mean to say:
"One would be to change the type on the FUNDING_SOURCES column to object."
You can't do this on the grid, you would have to do it on your data object class so that the actual property returns an object.
If you can't do that, then you could create an unbound column in the grid, in which case, you could make it of whatever type you want, including List<T>.
Hey Mike,
Sorry it's been so long since I've been able to come back to this, but I was pulled onto other projects. I am briefly experimenting with creating an UltraDataSource in the code from the data, and using it like you did, but I was hoping you'd expand some on part of your previous post:
Infragistics - Mike Saltzman said:There are a couple of ways you could handle this. One would be to change the type on the FUNDING_SOURCES column object. You could still store a List in it, but since it will be a single object, the BindingManager will treat it like a column.
So do you mean set Band.ColumnsCollection["FUNDING_SOURCES"]. Datatype = object? And then still put the List in that column, but maybe cast it to object first? I'm a but unclear how to proceed with this suggestion.
Thanks again for your time,
It's not showing up because you FUNDING_SOURCES column is a List<T> , so the BindingManager interprets it as a child band instead of as a normal column.
It worked for me, because UltraDataSource works differently and allows me to define the column as a column with a DataType of List<T>. But since you are using an object with properties, the BindingManager doesn't know that you want to treat the child list as a column and not a child band.
There are a couple of ways you could handle this. One would be to change the type on the FUNDING_SOURCES column object. You could still store a List in it, but since it will be a single object, the BindingManager will treat it like a column.
Another option would be to add an Unbound Column to the grid whose DataType is List<object>, and then you could populate that column in the InitializeRow event - copying the data from the child band into the unbound column. You would then have to reverse this process in the BeforeRowUpdate event to propagate the user's changes back to the data source.
Thanks for that sample, I just played with it some to make it look more like what I'm doing to see if I could get it to work, and for some reason, I can't even get the column for the dropdown list to show up.
Will you please see attached zip file for my version of your sample and have a look? I am certainly having a stupid hard time with this.
Thanks,J
I tested this out and it looks like the Value of the combo returns a List<object>. So the column in the grid has to be using that type.
I'm attaching my sample here so you can take a look.