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...
}
精彩评论