Hi
I am having problem with finding asp controls in the ItemTemplate in RadLightBox.
I have a RadComboBox and asp checkbox inside the RadLightBox ItemTemplate.
In my javascript I can find the RadComboBox, but cannot find the checkbox, it's getting null.
I also tried to find RadButton, it can find it, but how do I check it's checked or not from client side like asp checkbox.
But I still want to try to use asp checkbox so that css is consistent across our site.
Here is my code:
aspx:
<telerik:RadLightBox height="240" Width="890" ID="LightBox" Font-Size="Medium" runat="server" Modal="true" PreserveCurrentItemTemplates="true" style="z-index:99">
<ClientSettings >
<ClientEvents OnShowing="findControls" OnClosing="showHTMLScroll"/>
<AnimationSettings HideAnimation="Resize" NextAnimation="Fade" PrevAnimation="Fade" ShowAnimation="Resize" />
</ClientSettings>
<Items >
<telerik:RadLightBoxItem>
<ItemTemplate>
<div>
<div >
<asp:CheckBox ID="cb1" runat="server" Visible="true" />
<%--<telerik:RadButton ID="btnToggle" runat="server" ToggleType="CheckBox" ButtonType="LinkButton" >
<ToggleStates>
<telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
<telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
</ToggleStates>
</telerik:RadButton>--%>
</div>
<div>
<telerik:RadComboBox runat="server" ID="RCB" Width="300" Height="300" Skin="MetroTouch"
EmptyMessage="-Please Select -" CssClass="right-field" Visible="true"
>
</telerik:RadComboBox>
<span>
<asp:CustomValidator ID="cvl" runat="server" ValidationGroup="vgroup1" CssClass="error-label" ErrorMessage="Please select a reason"
ClientValidationFunction="cvlValidate" />
</span>
</div>
<div>
<span class="left-field left-label"> </span>
<asp:Button runat="server" CssClass="action-button" Text="Submit" value="Submit" ID="bnSubmit" CausesValidation="true" onclick="bnSubmitVoice_Click" ValidationGroup="vgroup1"/>
</div>
</div>
</ItemTemplate>
</telerik:RadLightBoxItem>
</Items>
</telerik:RadLightBox>
javascript:
function findControls() {
var cb = $find('<%= ((CheckBox)LightBoxReasonVoice.FindControl("cb1")).ClientID %>');;
var rcb = $find('<%= ((RadComboBox)LightBoxReasonVoice.FindControl("RCB")).ClientID %>');
alert("cb.checked");
}
I am having problem with finding asp controls in the ItemTemplate in RadLightBox.
I have a RadComboBox and asp checkbox inside the RadLightBox ItemTemplate.
In my javascript I can find the RadComboBox, but cannot find the checkbox, it's getting null.
I also tried to find RadButton, it can find it, but how do I check it's checked or not from client side like asp checkbox.
But I still want to try to use asp checkbox so that css is consistent across our site.
Here is my code:
aspx:
<telerik:RadLightBox height="240" Width="890" ID="LightBox" Font-Size="Medium" runat="server" Modal="true" PreserveCurrentItemTemplates="true" style="z-index:99">
<ClientSettings >
<ClientEvents OnShowing="findControls" OnClosing="showHTMLScroll"/>
<AnimationSettings HideAnimation="Resize" NextAnimation="Fade" PrevAnimation="Fade" ShowAnimation="Resize" />
</ClientSettings>
<Items >
<telerik:RadLightBoxItem>
<ItemTemplate>
<div>
<div >
<asp:CheckBox ID="cb1" runat="server" Visible="true" />
<%--<telerik:RadButton ID="btnToggle" runat="server" ToggleType="CheckBox" ButtonType="LinkButton" >
<ToggleStates>
<telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
<telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
</ToggleStates>
</telerik:RadButton>--%>
</div>
<div>
<telerik:RadComboBox runat="server" ID="RCB" Width="300" Height="300" Skin="MetroTouch"
EmptyMessage="-Please Select -" CssClass="right-field" Visible="true"
>
</telerik:RadComboBox>
<span>
<asp:CustomValidator ID="cvl" runat="server" ValidationGroup="vgroup1" CssClass="error-label" ErrorMessage="Please select a reason"
ClientValidationFunction="cvlValidate" />
</span>
</div>
<div>
<span class="left-field left-label"> </span>
<asp:Button runat="server" CssClass="action-button" Text="Submit" value="Submit" ID="bnSubmit" CausesValidation="true" onclick="bnSubmitVoice_Click" ValidationGroup="vgroup1"/>
</div>
</div>
</ItemTemplate>
</telerik:RadLightBoxItem>
</Items>
</telerik:RadLightBox>
javascript:
function findControls() {
var cb = $find('<%= ((CheckBox)LightBoxReasonVoice.FindControl("cb1")).ClientID %>');;
var rcb = $find('<%= ((RadComboBox)LightBoxReasonVoice.FindControl("RCB")).ClientID %>');
alert("cb.checked");
}