This is a migrated thread and some comments may be shown as answers.

Programmatically specify multiple 'ControlsToSkip'

1 Answer 56 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
mqsash
Top achievements
Rank 1
mqsash asked on 30 Aug 2013, 09:55 AM

I need to create a RadFormDecorator on the fly and add it to my page.
The FormDecorator also needs to skip a few types of controls for which I am using the ControlsToSkip property.
My code is as shown below

Dimfd = NewTelerik.Web.UI.RadFormDecorator()

fd.ID = "FormDecorator1"

fd.Skin = CStr(Session("SelectedSkin"))

 

fd.DecoratedControls = Telerik.Web.UI.FormDecoratorDecoratedControls.All

fd.ControlsToSkip = FormDecoratorDecoratedControls.Textbox

fd.ControlsToSkip = FormDecoratorDecoratedControls.Label

 

Form.Controls.Add(fd)



Now when I do this the fd.ControlsToSkip is only as good as the last control that is assigned to it. In the above scenario, when the form decorator gets added to the form, the controlsToSkip only contains the Label and not the TextBox.

When creating a formdecorator using the html markup we can specify multiple controls to skip using comma separated values, I was wondering how it can be done programmatically as well?

Thanks

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 30 Aug 2013, 01:28 PM
Hello,

I have just answered your support ticket on the matter and I am adding the information here for anyone else that may have a similar question:



Since this property is an enumerator you can use a logical OR to add values; having subsequent setters for the same property should be expected to leave only the last value:
RadFormDecorator1.ControlsToSkip = FormDecoratorDecoratedControls.Textbox Or FormDecoratorDecoratedControls.Label


Regards,
Marin Bratanov
Telerik
Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
Tags
FormDecorator
Asked by
mqsash
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or