
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.
Hi!
I'll get right to the point. I'm having problems with the ToolTip Manager. I have a RadGrid and to every label in one of the rows of the grid I add a tooltip (which loads on demand). What happens is I move the cursor over a label and the tooltip shows as expected. I click on whatever button on my page which generates a postback. Once again I move the cursor over a tooltip which again opens with no problem...and then.. my problem starts. In the next step if I click on whatever button or move the cursor over another label in order to show the tooltip, I get the following asp.net error:
| protected void Page_Load(object sender, EventArgs e) |
| { |
| (...) |
| RadToolTipManager1.TargetControls.Clear(); |
| if (!IsPostBack) |
| { |
| LoadData(Convert.ToString(ViewState["type"]), !IsPostBack); |
| } |
| (...) |
| } |
| private void LoadData(string type, bool withBind) |
| { |
| gridObjects.DataSource = mmObject.getDTObjectList(xxx, yyy); |
| if (withBind) |
| { |
| gridObjects.DataBind(); |
| } |
| } |
| protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args) |
| { |
| string value = Convert.ToString(args.Value); |
| this.UpdateToolTip(value, args.UpdatePanel); |
| } |
| private void UpdateToolTip(string filename, UpdatePanel panel) |
| { |
| Control ctrl = Page.LoadControl("~/controls/Community/ComDisplayImage.ascx"); |
| panel.ContentTemplateContainer.Controls.Add(ctrl); |
| panel.Visible = true; |
| ComDisplayImage options = (ComDisplayImage)ctrl; |
| options.Filename = filename; |
| } |
| protected void gridObjects_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridDataItem) |
| { |
| DataRowView row = (DataRowView)e.Item.DataItem; |
| string text = row["file_path"].ToString(); |
| System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("lblTitleItem"); |
| RadToolTipManager1.TargetControls.Add(label.ClientID, text, true); |
| } |
| } |
| <telerik:RadChart ID="RadChart1" runat="server" DataSourceID="SqlDataSource1" DefaultType="Pie" Skin="WebBlue" IntelligentLabelsEnabled="True" AutoTextWrap="True" AutoLayout="True" SeriesOrientation="Horizontal"> |
| <Series> |
| <telerik:ChartSeries DataLabelsColumn="ChartLabel" DataYColumn="Occurrences" Name="Occurrences" Type="Pie"> |
| <Appearance> |
| <LabelAppearance Distance="15"> |
| </LabelAppearance> |
| <Border Color="73, 86, 101" /> |
| <TextAppearance TextProperties-Color="140, 140, 140"> |
| </TextAppearance> |
| <FillStyle FillType="ComplexGradient" MainColor="94, 117, 142"> |
| <FillSettings> |
| <ComplexGradient> |
| <telerik:GradientElement Color="94, 117, 142" /> |
| <telerik:GradientElement Color="116, 138, 162" Position="0.5" /> |
| <telerik:GradientElement Color="139, 160, 183" Position="1" /> |
| </ComplexGradient> |
| </FillSettings> |
| </FillStyle> |
| </Appearance> |
| </telerik:ChartSeries> |
| </Series> |
| ... |
| </telerik:RadChart> |
| ... |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" |
| SelectCommand="SELECT COUNT(*) AS [Occurrences], incidentCode + ' (' + CAST(COUNT(*) AS nvarchar) + ')' AS [ChartLabel] FROM Incidents GROUP BY incidentCode"> |
| </asp:SqlDataSource> |
| ... |