Hi,
when I load a grid layout with LoadFromXml(), and the layout contains a column with a ValueList, the dropdown list does not appear.
You see the down-arrow button of the combobox in the cell, but there are no items.
I have to manually set the ValueList property for the column again to see the values of the list.
This also happens when using a BindableValueList.
Is this a bug or did I do anything wrong?
Thanks for your help.
How are you creating your ValueLists and how you are attaching them to the grid?
I'm not sure, but the grid might not be able to save the ValueList along with the grid layout unless you add it to the grid.DisplayLayout.ValueLists collection.
For example, I create the ValueList this way:
This works normally.
If I save and load the grid layout, the ValueList is not assigned to the column any more.
sorry, I forgot one step:
Please click the "Save Layout" button after loading the standard layout (in step 3).
Then the test.xml file is loaded when re-running the project, and the ValueList is not assigned to the column.
HI,
I have tested the described by you and as Michal Saltzman mentioned that may be you are loading an existing saved layout where the grid’s value list is not saved. Please check the sample I have attached:
1. Press “load data” – there must appear the lists for each cell
2. Press “save”
3. Rerun the application
4. Press “load” – the value list should be loaded
As your sample is not very clear for me, If you tell me what exactly you are trying to achieve I will be glad to help you.
Regards,
Stefaniya
there was no sample attached in your answer.
I tried to make a simpler sample than the one I posted before. What I want to do is saving and loading the layout automatically, but also give the user an option to load the default layout again, which I created at design time via the UltraGrid Designer (including the ValueLists!).
Please follow these steps to reproduce the problem:
As I described above, a workaround would be to set the ValueList property again. To test it, please uncomment line 33.
I apologize, I really have forgotten to upload the sample. I have modified your sample as I moved some code to the Load event of the form (please check it):
1. Run the sample
2. Press “No” to “Load saved layout?” – there must appear the grid with the valuelist defined in the initializeLayout event of the grid – this valuelist is saved in layout_default.xml on Load of the form
3. Click on “load valuelist” – the valuelist of the column is changed. If you click on “Load default layout” at this moment the previous saved valuelist will be displayed
4. Close the application – and the second valuelist will be saved in layout.xml
5. Rerun the application
6. Press “Yes” to “Load saved layout?” – the valuelist saved in layout.xml will be assigned to the column
Let me know if you have any questions.
your sample uses the workaround (line 33) I mentioned before. You re-assign the ValueList to the ValueList property of the grid column every time in the InitializeLayout method.
I think this should not be necessary, if I have already set this property via the Designer.
It seems like we do not find a solution for this, so I will set the property manually in the code after loading a grid layout.
Thank you,
Best regards
Please try the following:
1. The previous steps
2. Close the application – the two layouts are saved already
3. Remove everything from the InitializeLayout event in Form1.cs
4. Press “Yes” on “Load saved layout?” – the last saved valuelist should be assigned to the column
Please notice that in this scenario in layout_default.xml will not be saved any valuelist information and if loaded, after that on form closing in the other layout file will not be saved data for any valuelist.