开发者

access each Telerik control in my form

开发者 https://www.devze.com 2023-02-06 22:32 出处:网络
I use # and window application How can I found telerik controls in 开发者_Python百科my form. something like code bellow. but for telerik controls

I use # and window application

How can I found telerik controls in 开发者_Python百科my form.

something like code bellow. but for telerik controls

foreach (Control Ctrl in this.Controls) {}

thanks alot


Presuming you are using Winforms :

All RadControls derive from RadControl

therefore you could do the following :

foreach (Control ctrl in this.Controls)
{
     RadControl rc = ctrl as RadControl;
     if (rc != null)
     {
          //Do code for RadControl here
     }
}

or a LINQ based solution

var ctrls = this.Controls.OfType<RadControl>();

foreach (RadControl ctrl in ctrls)
{
    //Do Something...
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号