I would like to use the RadMaskedTextBox in the following scenario:
My user has a multiline textbox in which he can enter text. This text has a maximum length per line and
must match certain criteria. In this case it can be any character. When I set the text property of my
maskedtextbox the only thing that appears is my mask. I already tried to set the defaultmask, but when
the user clicks the textbox the default mask is applied. How should I use the RadMaskedTextBox.
The code I am using is posted below
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" /> <telerik:RadMaskedTextBox Width="300px" Height="80px" ID="RadMaskedTextBox1" runat="server" Label="Masked" TextMode="MultiLine" Mask = "aaa\r\naaa" TextWithLiterals = "123\r\n456" /> <br /> <telerik:RadTextBox Width="300px" Height="80px" ID="RadTextBox1" runat="server" Label="Normal" TextMode="MultiLine" Text = "123
456" /> </div> </form></body></html>
<telerik:RadComboBox runat="server" ID="selecao" Width="450" AutoPostBack="true" LoadingMessage="Loading..." EmptyMessage="Expanda a hierarquia e selecione..." OnClientDropDownOpened="OnClientDropDownOpenedHandler" EnableLoadOnDemand="true" MinFilterLength="3" OnInit="selecao_Init" OnItemsRequested="selecao_ItemsRequested" OnClientItemsRequested="OnClientItemsRequested"> <Items> <telerik:RadComboBoxItem Text="" Value="0"/> </Items> <ItemTemplate> <telerik:RadTreeView runat="server" ID="hierarquia" Width="300" RegisterWithScriptManager="FALSE" OnNodeExpand="hierarquia_NodeExpand" OnNodeClick="hierarquia_NodeClick" OnClientNodeClicking="nodeClicking" Skin="Default" CausesValidation="false" /> </ItemTemplate> </telerik:RadComboBox>
protected void selecao_Init(object sender, EventArgs e) { if (this.Hierarquia.Nodes.Count == 0) { RadTreeNodeCollection parent = this.Hierarquia.Nodes; // load data } #region ClientScriptBlock ScriptManager.RegisterClientScriptBlock(this, typeof(FiltroGenerico), "FiltroGenerico", @" function nodeClicking(sender, args) { var comboBox = $find(sender._clientStateFieldID.substring(0, sender._clientStateFieldID.length - 26)); var node = args.get_node() var fullname = ''; // display full treename as requested var pnode = node; while(pnode != null && pnode.get_text != null) { fullname = ' > ' + pnode.get_text() + fullname; pnode = pnode.get_parent(); } fullname = fullname.substr(3) comboBox.set_text(fullname); comboBox.trackChanges(); comboBox.get_items().getItem(0).set_text(fullname); comboBox.commitChanges(); comboBox.hideDropDown(); comboBox.attachDropDown(); } function StopPropagation(e) { if (!e) e = window.event; e.cancelBubble = true; } function OnClientItemsRequested(sender, eventArgs) { var tree = sender.get_items().getItem(0).findControl('hierarquia'); tree.add_nodeClicking(nodeClicking); } function OnClientDropDownOpenedHandler(sender, eventArgs) { var tree = sender.get_items().getItem(0).findControl('hierarquia'); var selectedNode = tree.get_selectedNode(); if (selectedNode) { selectedNode.scrollIntoView(); } }", true); #endregion }
scriptManager.IsInAsyncPostBackprotected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName.ToUpper() == "SELECT" || e.CommandName.ToUpper() == "SELECTNEWWINDOW") { GridDataItem item = RadGrid1.MasterTableView.Items[e.Item.ItemIndex]; string encryptedVal = Cryptography.Encrypt(item["AssetNumber"].Text); if (e.CommandName.ToUpper() == "SELECT") Response.Redirect(string.Format("~/Client/Asset/?id={0}", encryptedVal)); if (e.CommandName.ToUpper() == "SELECTNEWWINDOW") Helper.RedirectPage(Page, GetType(), string.Format("~/Client/Asset/?id={0}", encryptedVal), true); } } public static void RedirectPage(Page page, System.Type type, string url, bool openInNewWindow) { string urlResolved = page.ResolveUrl(url); if (!openInNewWindow) { ScriptManager scriptManager = ScriptManager.GetCurrent(page); bool isPartialPagePostback = false; if (scriptManager != null && scriptManager.IsInAsyncPostBack) isPartialPagePostback = true; if (isPartialPagePostback) ScriptManager.RegisterStartupScript(page, type, "''", "window.location.href='" + urlResolved + "'", true); else HttpContext.Current.Response.Redirect(url); } else { ScriptManager.RegisterStartupScript(page, type, "''", "window.open('" + urlResolved + "', '', 'height=600,width=800,scrollbars=yes,resizable=yes,location=yes')", true); } } Hi Team,
I am using Timeline view with 7 time slots and each slot is representing as a day. My requirement is when I click on Timeline column header; Day view should open for that specific date. But the problem is that when I go to click any of the column headers in Timeline view, there is no link button occurs so I am unable to click any time slot. Please give me some suggestion so that I can implement this functionality.
Thanks,
Deepak
Hi Team,
Here I have a scenario, in which I set AdaptiveRowHeight property as true. But the problem is because of this property is true, I am unable to drag my appointments vertical in different rows of month view. If there is any row which have at least one appointment then I can easily drag my appointments in that row, but if any row which haven’t any appointment in that case I am unable to drag it but if I will set AdaptiveRowHeight property as false then it works and I need to make this property true. Please give some suggestion.
Thanks,
Deepak
"RadTreeView1_NodeExpand" event on button click<asp:UpdatePanel ID="StepUpdatePanel" runat="server"> <ContentTemplate> <telerik:RadTreeView ID="trvSteps" runat="server" Height="400px" Style="border: 1px solid #CBE7F5;" OnNodeExpand="RadTreeView1_NodeExpand" OnDataBinding="RadTreeView1_NodeExpand"> <DataBindings> <telerik:RadTreeNodeBinding Expanded="True" /> </DataBindings> </telerik:RadTreeView> <%-- <asp:TreeView ID="trvSteps" runat="server" ShowLines="true" ExpandDepth="0" SelectedNodeStyle-BackColor="LightBlue" > </asp:TreeView>--%> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnReloadTreeview" EventName="Click" /> </Triggers> </asp:UpdatePanel>
Protected Sub RadTreeView1_NodeExpand(ByVal sender As Object, ByVal e As RadTreeNodeEventArgs) Dim objFileRouteStep As Business.FileRouteStep Dim dt As DataTable Try objFileRouteStep = New Business.FileRouteStep objFileRouteStep.Fields.FileRouteID.FileRouteID = hdnRouteID.Value.ToString() objFileRouteStep.Fields.Methods.AddInputParameter("@MonitoringDirectoryID", System.Data.SqlDbType.Int, 18, hdnMDirectoryID.Value) dt = objFileRouteStep.GetFileRouteStepDataTable(Data.FileRouteStep.SqlProcedures.USP_select_Step_ByFileRouteID) If (trvSteps.Nodes.Count = 0) Then Dim rootNode As New RadTreeNode("Root") rootNode.Value = "0" 'rootNode.ImageUrl = "~/TreeView/Img/Vista/folder.png" rootNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack trvSteps.Nodes.Add(rootNode) BindTreeToDirectory(e.Node.Value, e.Node) End If Catch ex As Exception End Try End Sub Private Sub BindTreeToDirectory(ByVal StepID As String, ByVal parentNode As RadTreeNode) Dim objFileRouteStep As Business.FileRouteStep Dim dt As DataTable Try dt = New DataTable If (StepID = "0") Then objFileRouteStep = New Business.FileRouteStep objFileRouteStep.Fields.FileRouteID.FileRouteID = hdnRouteID.Value.ToString() objFileRouteStep.Fields.Methods.AddInputParameter("@MonitoringDirectoryID", System.Data.SqlDbType.Int, 18, hdnMDirectoryID.Value) dt = objFileRouteStep.GetFileRouteStepDataTable(Data.FileRouteStep.SqlProcedures.USP_select_Step_ByFileRouteID) For Each dr As DataRow In dt.Rows Dim node As New RadTreeNode(dr("Step").ToString() + "-" + dr("Desc").ToString(), dr("StepID").ToString(), "javascript:clickNode(this, '" + dr("StepID").ToString() + "');") node.Value = dr("StepID").ToString() If (dr("SubNode").ToString() = "0") Then Else node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack End If parentNode.Nodes.Add(node) Next Else objFileRouteStep = New Business.FileRouteStep objFileRouteStep.Fields.Methods.AddInputParameter("@FileRouteID", System.Data.SqlDbType.Int, 18, StepID) dt = objFileRouteStep.GetFileRouteStepDataTable(Data.FileRouteStep.SqlProcedures.USP_select_childStep_ByFileRouteID) For Each dr As DataRow In dt.Rows 'If (dr("ParentID").ToString() = virtualPath.ToString()) Then Dim node As New RadTreeNode(dr("Step").ToString() + "-" + dr("Desc").ToString(), dr("StepID").ToString(), "javascript:clickNode(this, '" + dr("StepID").ToString() + "');") node.Value = dr("StepID").ToString() node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack parentNode.Nodes.Add(node) 'End If Next End If Catch ex As Exception Finally objFileRouteStep = Nothing dt = Nothing End Try End Sub