| <telerik:RadWindowManager ID="RadAlertWindow" runat="server" /> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
| <telerik:AjaxUpdatedControl ControlID="RadAlertWindow" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| protected void btnTest_Click(object sender, EventArgs e) |
| { |
| string verbiage = "Testing Alert"; |
| RadAjaxManager1.ResponseScripts.Add(@"radalert('" + verbiage + "', 330, 110);"); |
| } |
| function ShowForm(CID) { |
| window.radopen("FileInfo.aspx?cid="+CID, "OpenWindow"); |
| return false; |
| } |
| <telerik:RadWindowManager ID="RadWindowManager2" runat="server"> |
| <Windows> |
| <telerik:RadWindow ID="OpenWindow" runat="server" Title="Test" Height="500px" |
| Width="900px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" |
| Modal="true" /> |
| </Windows> |
| </telerik:RadWindowManager> |
| <telerik:RadAjaxPanel ID="ParentRadAjaxPanel" runat="server"> |
| <telerik:RadGrid ID="ParentRadGrid" runat="server" EnableEmbeddedSkins="false" Skin="BIC3RadSkin" |
| OnItemDataBound="RadGrid_ItemDataBound" OnColumnCreated="RadGrid_ColumnCreated" |
| OnNeedDataSource="RadGrid_NeedDataSource" OnSortCommand="RadGrid_SortCommand"> |
| <MasterTableView> |
| </MasterTableView> |
| </telerik:RadGrid> |
| </telerik:RadAjaxPanel> |
| protected void RadGrid_ItemDataBound(object sender, GridItemEventArgs newGridDataItem) |
| { |
| try |
| { |
| RadGrid radGrid = (RadGrid)sender; |
| #region Create Custom Header |
| if (newGridDataItem.Item.ItemType == GridItemType.Header) |
| { |
| #region Create links to charts |
| ... |
| // Box a the ItemType as it is easier to use |
| GridHeaderItem gridHeaderItem = (GridHeaderItem)newGridDataItem.Item; |
| // Iterate thorugh every column and format the value |
| foreach (GridColumn gridColumn in radGrid.MasterTableView.RenderColumns) |
| { |
| if (gridColumn.ColumnType != "GridExpandColumn" && gridColumn.ColumnType != "GridRowIndicatorColumn") |
| { |
| ... |
| try |
| { |
| // Create a LinkButton control instead of setting the columns' .text property or the javascript will not work |
| LinkButton linkButton = (LinkButton)gridHeaderItem[gridColumn.UniqueName].Controls[0]; |
| linkButton.Text = gridColumn.UniqueName; |
| // Create a hyperLink control for the chart to work and does not interfere with the sort LinkButton |
| if (_report.Grids[radGrid.ID][gridColumn.UniqueName].ChartColumnLink == true) |
| { |
| String chartParameters = String.Format(" <a alt=\"Click to view chart\" href=\"javascript:ViewChart('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}');\"><img border=\"0\" src=\"images/iconChart.gif\"></a>", _report.ManagerUserID.ToString(), _report.DepartmentID, Convert.ToByte(_report.DepartmentDrillDown), _report.Location, Convert.ToByte(_report.ShiftWindow), _report.StartDate.ToShortDateString(), _report.EndDate.ToShortDateString(), _report.ReportType, _report.AggregationPeriod, gridColumn.UniqueName); |
| HyperLink chartHyperLink = new HyperLink(); |
| chartHyperLink.Text = chartParameters; |
| gridHeaderItem[gridColumn.UniqueName].Controls.Add(chartHyperLink); |
| } |
| } |
| catch |
| { |
| // If this fails, allow the column name to go w/o the chart link by default |
| } |
| } |
| } |
| } |
| #endregion Create links to charts |
| } |
| #endregion Create Custom Header |
| ... // Create Custom Footer ommitted for easier troubleshooting |
| #region Put the proper formatting on values before display |
| if ((newGridDataItem.Item is GridDataItem) == true) |
| { |
| ... |
| GridDataItem gridDataItem = (GridDataItem)newGridDataItem.Item; |
| // Iterate thorugh every column and format the value |
| foreach (GridColumn gridColumn in radGrid.MasterTableView.RenderColumns) |
| { |
| if (_report.Grids[radGrid.ID].ContainsKey(gridColumn.UniqueName) == true) |
| { |
| // Create the grid data item text in a control or .text property |
| Label textLabel = new Label(); |
| if (gridDataItem[gridColumn.UniqueName].Text == "NaN") |
| { |
| // Weird: Add both text and a control. If there are more controls added below, the text is hidden but, if there are no other controls, the text will show. |
| textLabel.Text = RadGrid_FormatText(radGrid, gridColumn.UniqueName, "0"); |
| gridDataItem[gridColumn.UniqueName].Text = RadGrid_FormatText(radGrid, gridColumn.UniqueName, "0"); |
| } |
| else |
| { |
| // Do not display items that are special case exceptions governed by the .ReplaceHierarchyParentText property from xml |
| if (String.IsNullOrEmpty(_report.Grids[radGrid.ID][gridColumn.UniqueName].ReplaceHierarchyParentText) == false && gridDataItem.OwnerTableView.ParentItem == null) |
| { |
| textLabel.Text = _report.Grids[radGrid.ID][gridColumn.UniqueName].ReplaceHierarchyParentText; |
| gridDataItem[gridColumn.UniqueName].Text = _report.Grids[radGrid.ID][gridColumn.UniqueName].ReplaceHierarchyParentText; |
| } |
| else |
| { |
| // Weird: Add both text and a control. If there are more controls added below, the text is hidden but, if there are no other controls, the text will show. |
| textLabel.Text = RadGrid_FormatText(radGrid, gridColumn.UniqueName, gridDataItem[gridColumn.UniqueName].Text); |
| gridDataItem[gridColumn.UniqueName].Text = RadGrid_FormatText(radGrid, gridColumn.UniqueName, gridDataItem[gridColumn.UniqueName].Text); |
| } |
| } |
| gridDataItem[gridColumn.UniqueName].Controls.Add(textLabel); |
| #region Create a hyperLink control for the chart to work and does not interfere with the sort |
| // Create a hyperLink control for the chart to work and does not interfere with the sort LinkButton |
| if (_report.Grids[radGrid.ID][gridColumn.UniqueName].ChartRowLink == true) |
| { |
| String chartParameters = String.Format(" <a alt=\"Click to view chart\" href=\"javascript:ViewChart('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}');\"><img border=\"0\" src=\"images/iconChart.gif\"></a>", gridDataItem[_childRadGridProperties["MasterTableView.DataKeyNames"]].Text, _report.DepartmentID, Convert.ToByte(_report.DepartmentDrillDown), _report.Location, Convert.ToByte(_report.ShiftWindow), _report.StartDate.ToShortDateString(), _report.EndDate.ToShortDateString(), _report.ReportType, _report.AggregationPeriod, gridColumn.UniqueName); |
| HyperLink chartHyperLink = new HyperLink(); |
| chartHyperLink.Text = chartParameters; |
| gridDataItem[gridColumn.UniqueName].Controls.Add(chartHyperLink); |
| } |
| #endregion Create a hyperLink control for the chart to work and does not interfere with the sort |
| } |
| } |
| } |
| #endregion Put the proper formatting on values before display |
| } |
| catch (Exception exception) |
| { |
| //UNDONE: Wireup error handler object |
| Console.Write("error"); |
| } |
| } |
Hey,
I'm trying to get the value of a masked input field via javascript.
I'm using version 2.1.5.0 of the RadInput.Net2
On the founds I found:
http://www.telerik.com/community/forums/aspnet/input/radmaskedtextbox-javascript-value.aspx
http://www.telerik.com/community/forums/aspnet/input/input-into-radmaskedtextbox-with-qtp.aspx
However It's not working.
I've tried:
alert(document.getElementById('_ctl0_ph_txtSocialSecurityNumber').GetValue());
alert($find('_ctl0_ph_txtSocialSecurityNumber').GetValue());
alert(_ctl0_ph_txtSocialSecurityNumber.GetValue();
And a few other variations. Nothing works. I can get the value with jQuery and other methods but i need the unmasked version. The same functionality as the new version:
http://www.telerik.com/help/aspnet-ajax/input_clientsideradmaskedtextbox.html
get_value - Returns the value of the text box. This is the string without any prompt characters or literals.
Any ideas?
| <td valign="top" style="font-weight: normal" class="ms-formbody"> |
| <%-- <asp:DropDownList ID="ddlReferralSource" runat="server" Width="132"> |
| </asp:DropDownList>--%> |
| <telerik:RadComboBox runat="server" ID="radComboReferralSource" AllowCustomText="false" |
| EnableLoadOnDemand="false" MarkFirstMatch="true" OnClientSelectedIndexChanged="ValidateHearAboutUsSource" > |
| </telerik:RadComboBox> |
| <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="radComboReferralSource" |
| Display="Dynamic" SetFocusOnError="true" ErrorMessage="<%$Resources:CareerResources, Career_RequiredField%>" |
| ValidationGroup="profile" InitialValue="<%$Resources:CareerResources, Career_SelectText%>"></asp:RequiredFieldValidator> |
| </td> |
| <td> |
| <asp:TextBox runat="server" ID="txtHearAboutUsSourceValue"></asp:TextBox> |
| <asp:RequiredFieldValidator runat="server" ID="rfvHearAboutUsSourceValue" ControlToValidate="txtHearAboutUsSourceValue" |
| Display="Dynamic" SetFocusOnError="true" ErrorMessage="<%$Resources:CareerResources, Career_RequiredField%>" |
| ValidationGroup="profile" ></asp:RequiredFieldValidator> |
| </td> |
| <script type="text/javascript" language="javascript"> |
| function ValidateHearAboutUsSource(item, eventArgs) { |
| alert("test"); |
| var item1 = eventArgs.get_item(); |
| alert("You selected " + item1.get_text()); |
| var dropdownvalue = item.value; |
| alert(dropdownvalue); |
| var textBoxItem = document.getElementById('<%=txtHearAboutUsSourceValue.ClientID%>' |
| var validator = document.getElementById('<%=rfvHearAboutUsSourceValue.ClientID%>'); |
| } |
| </script> |