RadialGauge Controls List

Goal: I want to get list of RadialGauge Control  those exists on the form,and want to assign values in Loop.

I have created a list of RadialGauge Control, i can see name of all Controls Gauges exists on Form,But Can Not assign value to it.because intellisense dont show  GaugeControl[i].Value option it shows .Text option.

List<Control> GaugeControl = panelGaugeControl.Controls.OfType<RadialGauge>().Cast<Control>().ToList();

for (int i = 0; i < GaugeControl.Count; i++)
     {
string GaugeControlName = GaugeControl[0].Name;
GaugeControl[i].Text = 20;
}

3 Replies 1 reply marked as answer

UN Unknown Syncfusion Team July 27, 2020 08:00 AM UTC

Hi Muhammad, 

Thanks for contacting Syncfusion support. 

WE have checked your query “Value property is not shown in intellisense when try to set value for RadialGauge” and it seems that you cast the RadialGauge to Control type and stored it in list, In order to use the Value property of RadialGauge control please cast each controls from list as RadialGauge and use Value property or please change the list type as RadialGauge and store the number of RadialGauge controls in that list. Please refer the below code snippets for same. 

C#: 
List<Control> GaugeControl = this.Controls.OfType<RadialGauge>().Cast<Control>().ToList(); 
            for (int i = 0; i < GaugeControl.Count; i++) 
           
                string GaugeControlName = GaugeControl[0].Name; 
                (GaugeControl[i] as RadialGauge).Value = 20; 
           

Or 
List<RadialGauge> GaugeControl = this.Controls.OfType<RadialGauge>().ToList(); 
            for (int i = 0; i < GaugeControl.Count; i++) 
           
                string GaugeControlName = GaugeControl[0].Name; 
                GaugeControl[i].Value = 20; 
           

Regards, 
Niranjan Kumar Gopalan 


Marked as answer

MN MUHAMMAD NADEEM July 27, 2020 08:26 AM UTC

Dear Niranjan Kumar Gopalan , Thank You Very much it works.


UN Unknown Syncfusion Team July 27, 2020 08:33 AM UTC

Hi Muhammad, 

Thanks for your update. 

We are glad to know that reported query has been resolved. We are happy to assist you as always. 

Regards, 
Niranjan Kumar Gopalan 


Loader.
Up arrow icon