C# .NET - Clear all Controls in DevExpress - Asked By pravin on 21-May-13 03:42 AM

I wanna clear all the controls in a Form.
I have used the following Code:

    foreach (var control in this.Controls)
            {
              


                if (control is DevExpress.XtraEditors.TextEdit)
                {
                    ((TextBox)control).Text = "";
                }
                if (control is DevExpress.XtraEditors.CheckEdit)
                {
                    ((CheckEdit)control).Checked = false;
                }
                if (control is DevExpress.XtraEditors.LookUpEdit)
                {
                    ((LookUpEdit)control).EditValue = null;
                }
            } Am using LayoutControl so in Control variable is taking the layoutcontrol name not the control inside the Layout Control Is there any way to solve this..
Sathish S replied to pravin on 23-May-13 01:13 AM
Loop through layoutControl1.Controls instead of this.Controls. Layout control is a container control for all your controls.
pravin replied to Sathish S on 27-May-13 12:24 AM
Thanks a lot.. It is working fine