We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How can I change the Appearance of the Grid during run time?

 

1. In the Designer, after making the appropriate changes to the Appearance settings of the Grid click on the Save Look and Feel Verb which gives you an option to save the settings to an XMLfile.

2. In the Solution Explorer for the project, right click on the project name and choose Add->Add Existing Item and choose look and feel XML file. Ensure that the Build Action property for this file is set to Embedded Resource.

The following code snippet shows how this can now be used to change the look and feel of the GridControl during run time (from orangeblue.xml file)

C#

// Apply Look and Feel saved in orangeblue.xml

System.IO.Stream strm = typeof(Skins.WebForm1).Assembly.GetManifestResourceStream("Skins.orangeblue.xml");

System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader(strm);

GridGroupingLookAndFeel laf = GridGroupingLookAndFeel.CreateFromXml(reader);

laf.ApplyTo(this.GridGroupingControl);

reader.Close();

strm.Close();

VB

'Apply Look and Feel saved in orangeblue.xml

Dim strm As System.IO.Stream = GetType(Skins.WebForm1).Assembly.GetManifestResourceStream("orangeblue.xml")

Dim reader As System.Xml.XmlTextReader = New System.Xml.XmlTextReader(strm)

Dim laf As GridGroupingLookAndFeel = GridGroupingLookAndFeel.CreateFromXml(reader)

laf.ApplyTo(Me.GridGroupingControl)

reader.Close()

strm.Close()

Article ID: Published Date: Last Revised Date: Platform: Control:
544 04/30/2011 07/10/2014 ASP.NET Web Forms (Classic) GridGroupingControl
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.