4 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 07 Jan 2014, 05:08 AM
Hi Frank,
Please have a look into the following code snippet to access the ItemTemplate control of RadLightBox from client side.
ASPX:
JavaScript:
Thanks,
Princy.
Please have a look into the following code snippet to access the ItemTemplate control of RadLightBox from client side.
ASPX:
<
telerik:RadLightBox
ID
=
"CodeLightBox"
runat
=
"server"
Width
=
"1000px"
Modal
=
"true"
Height
=
"200px"
>
<
ClientSettings
>
<
AnimationSettings
HideAnimation
=
"Resize"
NextAnimation
=
"Fade"
PrevAnimation
=
"Fade"
ShowAnimation
=
"Resize"
/>
</
ClientSettings
>
<
Items
>
<
telerik:RadLightBoxItem
>
<
ItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadTextBox1"
runat
=
"server"
CssClass
=
"demo"
>
</
telerik:RadTextBox
>
</
ItemTemplate
>
</
telerik:RadLightBoxItem
>
</
Items
>
</
telerik:RadLightBox
>
JavaScript:
<script type=
"text/javascript"
>
function
OpenCodeLightBox() {
var
lightBox = $find(
'<%=CodeLightBox.ClientID %>'
);
lightBox.show();
var
Text = lightBox.get_element().getElementsByClassName(
"demo"
);
Text.CodeLightBox$RadTextBox1.control.set_value(
"new value"
);
}
</script>
Thanks,
Princy.
0
Frank
Top achievements
Rank 1
answered on 07 Jan 2014, 03:41 PM
Thank you Princy! I did not see the get_element() in the online documentation.
0
Eduardo
Top achievements
Rank 1
answered on 23 Apr 2015, 07:55 PM
How do I access a template radlightbox in C # instead of the script below:
<script type="text/javascript"> function OpenCodeLightBox() { var lightBox = $find('<%=CodeLightBox.ClientID %>'); lightBox.show(); var Text = lightBox.get_element().getElementsByClassName("demo"); Text.CodeLightBox$RadTextBox1.control.set_value("new value"); }</script>
Tanks.
0
Hello,
If you want to access the RadLigthtBox you can do this directly by using its ID. However if you want to access the RadTextBox inside the ItemTemplate of the first item you can do something like this.
C#:
Regards,
Angel Petrov
Telerik
If you want to access the RadLigthtBox you can do this directly by using its ID. However if you want to access the RadTextBox inside the ItemTemplate of the first item you can do something like this.
C#:
RadTextBox textBox1=CodeLightBox.FindControl(
"RadTextBox1"
)
as
RadTextBox;
Regards,
Angel Petrov
Telerik
See What's Next in App Development. Register for TelerikNEXT.