Hi,
I have one problem when validating controls in client side, Suppose i have four controls in formtemplate in radgrid control..
If anyone checked the checkbox that is also exist in the radgrid control i have to apply the validation on other controls that is also exist in the raddgrid control.
Please give me the solution how to validate the controls value at client side while one of control has favourable value, otherwise do not apply the validation.
In my form CheckBox like ::
<asp:CheckBox id="CheckBoxIsActive" TabIndex="21" runat="server" Width="150px" Text="Active User"></asp:CheckBox>
if this check box is checked
than i have to validate the following controls
asp
:TextBox id="TextBoxUser_Name" TabIndex="18" MaxLength ="256" runat="server" Width="150px"></asp:TextBox>
<
asp:RequiredFieldValidator ID="RequiredFieldValidatorUserName" Display="None" ValidationGroup="Check" runat="server" ControlToValidate="TextBoxUser_Name"
ErrorMessage="Please enter user name" ></asp:RequiredFieldValidator>
Kindly give me the solution how to validate the control if checkbox is valid.
<
telerik:RadGrid ID="rgStaffPersonDetails" GridLines="None" EnableAJAX="True" runat="server" Skin ="WebBlue" width="100%"
AutoGenerateDeleteColumn ="True" AutoGenerateEditColumn ="True" AutoGenerateColumns="false"
OnItemCommand="rgStaffPersonDetails_ItemCommand" OnItemDataBound="rgStaffPersonDetails_ItemDataBound" OnInit="rgStaffPersonDetails_Init"
OnInsertCommand="rgStaffPersonDetails_InsertCommand" OnUpdateCommand="rgStaffPersonDetails_UpdateCommand" OnItemCreated="rgStaffPersonDetails_ItemCreated" >
<PagerStyle Mode="NumericPages"></PagerStyle>
<MasterTableView CommandItemDisplay= "Top" DataKeyNames="Staff_Per_ID" >
<
Columns >
<telerik:GridBoundColumn DataField="Staff_Per_ID" Visible="False" DataType="System.Int32" HeaderText="Per_ID"
SortExpression="Per_ID" UniqueName="Per_ID">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Person Name" UniqueName="StaffName">
<
ItemTemplate>
<asp:Label ID="lblStaffName" runat="server" Text='<%# Eval("Staff_Per_IDSource.Per_FirstName")+" "+Eval("Staff_Per_IDSource.Per_MiddleName")+" "+Eval("Staff_Per_IDSource.Per_LastName")%>'></asp:Label>
</
ItemTemplate>
</
telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Per_HomePhone" HeaderText="Home Phone">
<
ItemTemplate>
<asp:Label ID="lblPer_CellPhone" runat="server" Text='<%# (Eval("Staff_Per_IDSource.Per_HomePhone") == "") ? "N/A" : String.Format("{0:(###) ###-####}", Eval("Staff_Per_IDSource.Per_HomePhone"))%>'></asp:Label>
</
ItemTemplate>
</
telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Per_WorkPhone" HeaderText="Work Phone">
<
ItemTemplate>
<asp:Label ID="lblworkphone" runat="server" Text='<%# (Eval("Staff_Per_IDSource.Per_WorkPhone") == "") ? "N/A" : String.Format("{0:(###) ###-####}", Eval("Staff_Per_IDSource.Per_WorkPhone"))%>'></asp:Label>
</
ItemTemplate>
</
telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Per_CellPhone" HeaderText="Cell Phone">
<
ItemTemplate>
<asp:Label ID="lblCellphone" runat="server" Text='<%# (Eval("Staff_Per_IDSource.Per_CellPhone") == "") ? "N/A" : String.Format("{0:(###) ###-####}", Eval("Staff_Per_IDSource.Per_CellPhone"))%>'></asp:Label>
</
ItemTemplate>
</
telerik:GridTemplateColumn>
<telerik:gridtemplatecolumn UniqueName="username" HeaderText="User Name">
<
itemtemplate>
<asp:label id="lblusername" runat="server" text='<%# Eval("Staff_User_IDSource.UserName") %>'></asp:label>
</
itemtemplate>
</
telerik:gridtemplatecolumn>
</
Columns>
<ExpandCollapseColumn Resizable="False" Visible="False">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<EditFormSettings EditFormType="Template">
<PopUpSettings ScrollBars="None" />
<FormTemplate >
<table id="Table2" cellspacing="2" cellpadding="1" width="70%" border="1" rules="none"
style="BORDER-COLLAPSE: collapse">
<tr class="EditFormHeader">
<td colspan="2"><b>Staff Person Detail</b></td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td align ="right" style="width: 15%;">First Name:</td>
<td style=" width: 15%;"> <telerik:RadTextBox id="TextBoxFirst_Name" MaxLength ="40" TabIndex="1" Width="150px" runat="server" >
</telerik:RadTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidatorFirst_Name" runat="server" Display="None" ValidationGroup="Check" ControlToValidate="TextBoxFirst_Name"
ErrorMessage="Please enter first name" ></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align ="right" style="width: 15%;" valign="middle">UserName:
</td>
<td style="width: 15%;" valign="middle"><asp:TextBox id="TextBoxUser_Name" TabIndex="18" MaxLength ="256" runat="server" Width="150px"
></asp:TextBox>
</td>
<td align ="right" style="width: 15%;" valign="middle">Password:
</td>
<td style="width: 20%;" valign="middle"><opp:PasswordTextBox id="TextBoxPassword" runat="server" TabIndex="19" />
</td>
<td align ="right" style="width: 20%;" valign="middle">
Re-Enter:
</td>
<td style="width: 20%;" valign="middle"><opp:PasswordTextBox id="TextBoxRePassword" runat="server" TabIndex="20" />
</td>
</tr>
<tr>
<td align="right" style="width: 15%; height: 25px;" valign="top">
</td>
<td style="width: 15%; height: 25px;" valign="top">
<asp:CheckBox id="CheckBoxIsActive" TabIndex="21" runat="server" Width="150px" Text="Active User"></asp:CheckBox></td>
<td align="right" style="width: 15%; height: 25px;" valign="top">
</td>
<td style="width: 20%; height: 25px;" valign="top">
</td>
<td align="right" style="width: 20%; height: 25px;" valign="top">
</td>
<td style="width: 20%; height: 25px;" valign="top">
<asp:RequiredFieldValidator ID="ReqTextBoxRePassword" runat="server" ControlToValidate="TextBoxRePassword" ValidationGroup="Check" Display="None" ErrorMessage="Please Re-Enter Password"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td align ="right" style="width: 15%;">
</td>
<td style="width: 15%;">
<asp:RequiredFieldValidator ID="RequiredFieldValidatorUserName" Display="None" ValidationGroup="Check" runat="server" ControlToValidate="TextBoxUser_Name"
ErrorMessage="Please enter user name" ></asp:RequiredFieldValidator></td>
<td align="left" colspan="2"><asp:ValidationSummary ID="ValidationSummary2" runat="server" ValidationGroup="Check" DisplayMode ="BulletList" Width="100%" />
<asp:CompareValidator ID="CompareValidatorPassword" runat="server"
ErrorMessage="Please enter same password" ValidationGroup="Check" ControlToCompare="TextBoxPassword" ControlToValidate="TextBoxRePassword" Display="None"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="ReqTextBoxPassword" ControlToValidate="TextBoxPassword" ValidationGroup="Check" runat="server" Display="None" ErrorMessage="Please enter Password"></asp:RequiredFieldValidator></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" colspan="2"><asp:Button id="cmdButton" ValidationGroup="Check" runat="server" Text='Update' TabIndex="23" CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>'>
</asp:Button></td><td><asp:Button id="btnCancel" runat="server" Text="Cancel" TabIndex="24" CausesValidation="False" CommandName="Cancel">
</asp:Button> </td>
</tr>
</
table>
</FormTemplate>
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
</
MasterTableView>
</telerik:RadGrid>
Please give me the solutuion either javascript ofr any other way, Actually i am using this grid in the usercontrol that's what i am unable to get the control's Id at runtime as matched.