Important
This example uses internal APIs that may change in newer versions.
The VisibleIndex property returns -1 if a column is hidden. This example demonstrates how to implement a serializable property that stores the visible index of a column before the column is hidden. This allows you to save and restore the position of hidden columns when saving/loading the grid layout.
-
Create a
GridColumn
descendant (MyGridColumn
). -
Implement a new property and apply the
XtraSerializableAttribute
attribute:private int oldVisibleIndex = -1; [XtraSerializableProperty, XtraSerializablePropertyId(LayoutIdLayout)] public int OldVisibleIndex { get { return oldVisibleIndex; } set { if (value == -1) return; oldVisibleIndex = value; } }
(you will be redirected to DevExpress.com to submit your response)