So is anyone else seeing the code values in a valuelist instead of the text when doing a print preview on the grid 2011.1? Dropdowns seem to be showing fine. Believe this was working fine many versions ago. Just trying to figure out if it's me or Memorex.
Thanks,
Nick
Hi Nick,
This is a very odd bug. I don't see why adding the ValueList into a ValueListsCollection is having an effect here. My best guess is that being in a collection is preventing the grid from cloning the ValueList - but that should not be the case.
May I ask why you are using a ValueListsCollection? It's kind've strange to use a separate ValueListsCollection outside of the grid and then pass in the grid's Appearances collection to it. If you want to store the ValueList in a collection, then it would be better to simply use the existing ValueLists collection on the grid.DisplayLayout. This collection is already hooked up to the Appearances collection on the DisplayLayout.
Just FYI, the only reason the ValueListsCollection requires you to pass in the Appearances is so that the ValueLists and the ValueListItems can reference an Appearance by key. So unless your ValueLists are actually referencing the Key of an appearance instead of the Appearance object itself directly, this is unnecessary.
Now that, in itself, probably doesn't help you, but if you are not directly using the keys of the Appearances, then you might be able to work around this issue more easily by simply replacing ValueListCollection with List<ValueList>.
Will look forward to your results or a better workaround. It's not going to be a simple task to recode everything as you suggest because these are all built dynamically on the fly for a couple hundred grids or so.
Thanks
Hello ,
I will investigate this issue further to find why this code do not work properly, meanwhile you could use the approach that was shown in the sample in my previous post:
ValueList vl = new ValueList();
vl.ValueListItems.Add(1,"value1").Appearance.BackColor = Color.Red;
vl.ValueListItems.Add(2,"value2");
vl.ValueListItems.Add(3,"value3");
e.Layout.Bands[0].Columns[0].ValueList = vl;
I will update you for my findings as soon as I have information for you.
Tracked back through the versions if that might perhaps help some.
Worked in version 10.2
Stopped working in Version 10.3.
I place my valuelists into a collection and use them when needed. I am not a c# person but I believe if you replace your InitializeLayout code with the following you will see the problem:
private
e)
{
();
vl.ValueListItems.Add(1,
);
vl.ValueListItems.Add(2,
vl.ValueListItems.Add(3,
(ultraGrid1.DisplayLayout.Appearances);
vlc.Add(vl);
e.Layout.Bands[0].Columns[0].ValueList = (
) vlc.GetItem(0);