error: Unable to cast object of type 'Telerik.Web.UI.RadMultiPage' to type 'System.Web.UI.UserControl'.
When going through a user control for a EditFormUserControl and I wanted to list all the user controls on that page but doing a foreach loop I need a fairly consistent type to iterate through. So how can I iterate through 'userControl' when it could be a lteral for a label or a 'RadMultiPage' or a 'UserControl'. I have tried ...string objectTypeName="RadMultiPage";
When going through a user control for a EditFormUserControl and I wanted to list all the user controls on that page but doing a foreach loop I need a fairly consistent type to iterate through. So how can I iterate through 'userControl' when it could be a lteral for a label or a 'RadMultiPage' or a 'UserControl'. I have tried ...string objectTypeName="RadMultiPage";
Type
T = Type
.GetType(objectTypeName);
((
typeof(T)))userControl).Controls
But I just wanter to be able to have a reursive call listing out all the children be them Usercontrol or Telerik User controls.
Any Ideas ?
Doug
UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
foreach
(object uc in ((UserControl)userControl).Controls){}