Grid.DisplayLayout.SaveAsXml - PropertyCategory
I have been using PropertyCategory.All but that is producing 2 issues that I would like resolved:
When I add or remove a column in the code, it still shows the old columns in ShowColumnChooser. I would like to retain the visible column position and list of visible columns from ShowColumnChooser but I would like to have any new columns / bands that are added or removed to show up in the ShowColumnChooser. So basically, I want to retain the existing column information (size, position, visiblility, etc.) but also get the new information (I wouldn't mind if the new columns were hidden but they do show up under the column chooser for the user to add).
I also don't want to retain appearances (aka I want the information like background color to come from the code).
What PropertyCategory do I need to use?
Hi,
I'm having trouble understanding your questions.
If you add a column to the grid, the ColumnChooser should show those columns. If they are not showing up, then something is wrong. There is a property on the column called ExcludeFromColumnChooser. If you set this property to true, then the column is explicitly not shown in the ColumnChooser. But as long as you do not set this property, the column should display. If it's not, then it's a bug.
haessd said:I also don't want to retain appearances (aka I want the information like background color to come from the code).
What appearances are you referring to? All of them?
I don't beleive it's possible to load a layout without applying the appearances. You can choose not to save the AppearancesCollection, but that only help if all of your appearances are coming from that collection.
>> If you add a column to the grid, the ColumnChooser should show those columns. If they are not showing up, then something is wrong. There is a property on the column called ExcludeFromColumnChooser. If you set this property to true, then the column is explicitly not shown in the ColumnChooser. But as long as you do not set this property, the column should display. If it's not, then it's a bug.
You are correct about missing columns showing up - Although the appearance of the missing columns is incorrect - for instance I add a new column with Key = "REPLACEABLE_PARTS' and Header = "Parts", when the application is ran, it shows "REPLACEABLE_PARTS" for the Header which is incorrect. I would like the appearance of new columns to match the code.
Additionally: Minor thing - I did get a crash (10.3 of Net Advantage) when I renamed a hidden unbound column (renamed the Key) and referenced the renamed hidden column in code. The LoadFromXml I guess didn't rename the key of the column (I guess because it was hidden). I think this is what caused the crash but I am not too concerned about this - only happened once since it won't happen very frequently.
>> What appearances are you referring to? All of them?
I would like to have the following to come from code (header, cell background color, cell click action, cell activation, cell style, cell multiline, ...). I would like the following to come from the XML file (cell position, cell width, sorting, etc.).