I've been playing around with SaveLayout and gotten it to work with the standard SaveLayout.
But I'm looking for a way to save ONLY the layout information (column width, column order,visible columns, etc).
I can't seem to find a way to do it.
This is what I've tried so far:
RadGridView1.XmlSerializationInfo.SerializationMetadata.Clear()
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(RadGridView),
"MasterTemplate"
, ComponentModel.DesignerSerializationVisibilityAttribute.Content)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(GridViewTemplate),
"FilterDescriptors"
, ComponentModel.DesignerSerializationVisibilityAttribute.Content)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(CompositeFilterDescriptor),
"FilterDescriptors"
, ComponentModel.DesignerSerializationVisibilityAttribute.Content)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(CompositeFilterDescriptor),
"LogicalOperator"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(FilterDescriptor),
"PropertyName"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(FilterDescriptor),
"Operator"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(FilterDescriptor),
"Value"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(FilterDescriptor),
"IsFilterEditor"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(GridViewTemplate),
"Columns"
, ComponentModel.DesignerSerializationVisibilityAttribute.Content)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(GridViewDataColumn),
"Name"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(GridViewDataColumn),
"Width"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.SaveLayout(mStream)
It gives me a blank result.
THIS works for filtering but not any of the column info (width, order, visible):
RadGridView1.XmlSerializationInfo.DisregardOriginalSerializationVisibility =
True
RadGridView1.XmlSerializationInfo.SerializationMetadata.Clear()
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(RadGridView),
"MasterTemplate"
, ComponentModel.DesignerSerializationVisibilityAttribute.Content)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(GridViewTemplate),
"FilterDescriptors"
, ComponentModel.DesignerSerializationVisibilityAttribute.Content)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(CompositeFilterDescriptor),
"FilterDescriptors"
, ComponentModel.DesignerSerializationVisibilityAttribute.Content)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(CompositeFilterDescriptor),
"LogicalOperator"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(FilterDescriptor),
"PropertyName"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(FilterDescriptor),
"Operator"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(FilterDescriptor),
"Value"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.XmlSerializationInfo.SerializationMetadata.Add(
GetType
(FilterDescriptor),
"IsFilterEditor"
, ComponentModel.DesignerSerializationVisibilityAttribute.Visible)
RadGridView1.SaveLayout(mStream)
What am I missing?