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 to configure State Persistence for RadialGauge control?

State Persistence support helps end users to save the application / controls customization based on their needs. So, it is a very essential feature and some controls may not have support to Serialize and Deserialize its customization settings by built-in.  This article will provide guidance to configure State Persistence for those controls in sample application level. 

 

For example

Here we have considered RadialGauge control. At present RadialGauge doesn’t have built-in State Persistence support and its property information can be programmatically saved / load from XML by following below steps.

 

Step 1: Define Class that helps Serialize / De-Serialize RadialGauge property details and mark it as XMLRoot attribute.

Step 2: Implement required properties of RadialGauge that needs to be Serialized / De-Serialized in this class and mark it as XMLElement attribute.

Step 3: Save those properties using XMLTextWriter class, that helps to store information in XML file.

Step 4: Load those properties using XMLTextReader class, that helps to retrieve information from XML file.

 

For example

 

Here, we have Serialized / Deserialized the “Value” and “VisualStyle” properties of RadialGauge control.

 

The following code demonstrates the same.

 

Code Example: [C#]

 

 

Code Example: [VB]

 

 

Sample

 

C#:  RadialGaugeSerializationSample

 

VB:  RadialGaugeSerializationSample

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework:
9121 08/10/2018 08/10/2018 Windows Forms RadialGauge 4
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.