Hello: I am programmatically setting the stye and the value list in my application:
ugBED.DisplayLayout.Bands(0).Columns("Status_CD_C").Style = ColumnStyle.DropDownList
ugBED.DisplayLayout.Bands(0).Columns("Status_CD_C").ValueList = fvlStatus
But the second statement is raising an error, "ValueList.Appearances must be the same as the grid's layout.Appearances
fvlStatus is valid with 4 valueitems.
What am I doing wrong?
venki
Hi Venki,
How are you creating 'fvlStatus'? My guess is that this ValueList belongs to some other control, and you are trying to use it for that other control and also for the grid. I don't think that will work. You can't share the same ValueList between multiple controls.
Mike:
Yes, I have on valuelist object created that is being used as valuelist for two grids.
I have used similar approach for another field (User_ID_C) which is bound to a UltraDropdown-type object but the only difference is that the columns were activate only.
I will create another instance of this valuelist object and see if this probem.
Venki
I created a copy of the valuelist variable and made sure that each grid is bound to a distinct valuelist. But the error is still occurring.
Hi,
Are you sure you are assigning a different ValueList to each grid? The error message indicates that the ValueList is already linked up to the Appearances collection of one control, but you are trying to assign it to some other control.
It may be that when you Clone the ValueList, it's also cloning the associated with the control. Make sure you create the ValueList first, then clone it before you assign it to any controls.
Thank you for your guidance. I discovered that cloning a value list object and binding that to another grid column does not work. You have to create a new value list object, add the valuelist members and bind it to the grid column.
However, the same valuelist can be bound to multiple columns in the same grid or different grids as long as the user cannot modify any of those columns.
Hello vvenk,
Thank you for your feedback. Please do not hesitate to contact us if you still have questions regarding this matter.