开发者

access each Telerik control in my form

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜