C1.Win.C1FlexGrid Namespace > CellStyle Class > BuildString Method : BuildString() Method |
'Declaration
Public Overloads Function BuildString() As String
public string BuildString()
public: String^ BuildString();
This method is used to persist grid styles and can be used to define and save 'skins'.
See the CellStyleCollection.BuildString and CellStyleCollection.ParseString methods.
The string returned contains definitions only for the style elements that are defined by this CellStyle. Elements inherited from other styles are not included. To build a string containing specific elements, use the BuildString(StyleElementFlags) method instead.
// create style with custom font and back color CellStyle cs = _flex.Styles.Add("s1"); cs.Font = new Font("Arial", 12, FontStyle.Bold); cs.BackColor = Color.Beige; // save style definition into a string string styleDef = cs.BuildString(); // use string to initialize another style CellStyle csNew = _flex.Styles.Add("s2"); csNew.ParseString(styleDef); // compare styles Debug.Assert(csNew.Font.Equals(cs.Font)); Debug.Assert(csNew.BackColor.Equals(cs.BackColor));
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2