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. Image for the cookie policy date

SyncFusion Controls

Hi there, Is there any replacement for the below code in the SyncFusion Controls System.Windows.Forms.Control Ctrl; foreach (System.Windows.Forms.Control ctrl in ctrl.Controls) All my forms are using SyncFusion Controls like TextBox, Combobox, TreeView. Thanks Satish

3 Replies

AD Administrator Syncfusion Team May 17, 2004 07:57 AM UTC

Syncfusion UI controls are derived from System.Windows.Forms.Control, so you can loop through a Syncfusion control''s Control collection using the similar code. Eactly what are you trying to do that is not working for you?


SA Satish May 18, 2004 09:43 AM UTC

Thanks for your reply. I want to change the background color the control at runtime for all the controls on the form. Assuming that, we have both Windows control as well as Syncfusion Control. Now My problem is how can loop through the Syncfusion Control. I could able to loop through the Windows control Thanks Satish >Syncfusion UI controls are derived from System.Windows.Forms.Control, so you can loop through a Syncfusion control''s Control collection using the similar code. > >Eactly what are you trying to do that is not working for you?


AD Administrator Syncfusion Team May 18, 2004 10:20 AM UTC

When you loop through your form1.Controls, it should return both Windows Forms controls and Syncfusion controls that have been added to the form''s Control''s collection. At this point, the Syncfusion controls are just Windows Forms controls. One other comment is that to loop through all controls on a form, you need to do it recursively. Container controls like panels and groupboxes can host child controls in its controls collection. (Note, if one of these Controls is a GridControlBase (GridControl or GridDataBoundGrid), setting Control.BackColor will not affect the look of the grid. Instead you would have to set GridControlBasae.TableStyle.BackColor).

Loader.
Live Chat Icon For mobile
Up arrow icon