
I am using this control for Phone numbers and I need a way to strip out the bad characters when Users are copying/pasting from other applications. If the User tries to paste a phone number that
does not match, it screws up the text. Example:
User tries to paste: 480.123. 4567
Result is: (480) _12-3_45
What I want to do is capture the event and remove, replace, etc. the offending character(s) such that they can copy and paste some bad formats. Typical formats;
480.123.4567
480/ 123 4567
480/123-4567
480 123 4567
480-123-4567
How can I capture this event? I have read the documents online and experimented with several events but can’t get anything to work. Thank you for your help.
Michael J. Boles

| <telerik:RadComboBox ID="RadComboBoxSD" runat="server"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| <ItemTemplate> |
| <div id="div1"> |
| <telerik:RadTreeView runat="server" ID="RadTreeViewSD" > |
| <CollapseAnimation Duration="100" Type="OutQuint" /> |
| <ExpandAnimation Duration="100" /> |
| </telerik:RadTreeView> |
| </div> |
| </ItemTemplate> |
| <Items> |
| <telerik:RadComboBoxItem Text="" /> |
| </Items> |
| </telerik:RadComboBox> |
| private void LoadRootNodes() |
| { |
| RadTreeView RadTreeViewSD = (RadTreeView)RadComboBoxSD.FindControl("RadTreeViewSD"); |
| SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["RemoteSqlServerData"].ConnectionString); |
| SqlCommand selectCommand = new SqlCommand("SELECT [id],[regionName] FROM tRegion ORDER BY regionName", connection); |
| SqlDataAdapter adapter = new SqlDataAdapter(selectCommand); |
| DataTable data = new DataTable(); |
| adapter.Fill(data); |
| foreach (DataRow row in data.Rows) |
| { |
| RadTreeNode node = new RadTreeNode(); |
| node.Text = row["regionName"].ToString(); |
| node.Value = row["id"].ToString(); |
| node.ExpandMode = TreeNodeExpandMode.ServerSide; |
| RadTreeViewSD.Nodes.Add(node); |
| } |
| } |
<telerik:RadEditor ID="RadEditor1" runat="server" ToolbarMode="Default" Width="600px" Height="600px" EditModes="Design">
<CssFiles>
<telerik:EditorCssFile Value="~/Css/EditPageContentMiska.css" />
</CssFiles>
<Content>
</Content>
</telerik:RadEditor>
everything works just fine (the defaults styles are imported from css file), while as to if i do it behind the code like:
RadEditor1.CssFiles.Add("~/Css/EditorPageContentMiska.css");
then the styles dont apply to my content area. I'm setting editor's css file on Page_Load event. Am i doing something wrong? (need this coz the style defaults will be changed based on login)
thanks in advance,
Žiga
*** edit
The behind code works just fine - i had some trouble with cached css i guess. But the problem is still described in my 2nd post (only css defaults for body element are applyed)
Hopefully this inqury is a quick one although I have 2 issues.
I just migrated to the ajax asp treeview.
I want a tree inside a combo box type of functionality. Following a sample I found on this site, my original setup looked like this:
<
asp:TextBox ID="txtSelection" ReadOnly="true" runat="server"></asp:TextBox>
<asp:Image runat="server" ID="imgBoxArrow" ImageUrl="~/Images/boxArrow.gif" onclick="ToggleTreeView()" />
<asp:RequiredFieldValidator ID="required" runat="server"Text = "*" Visible= "true" ControlToValidate="txtSelection" Display="Dynamic" />
<div id="tvDiv" class="treeDiv">
<asp:UpdatePanel ID="UpdatePanelTreeView" runat="server">
<ContentTemplate>
<radT:RadTreeView ID="tv" runat="server" Height="200px" Width="100%" EnableViewState="true"RetainScrollPosition="true" RadControlsDir="/RadControls/" SkinsPath="/RadControls/Treeview/Skins"AutoPostBack="False" OnNodeExpand="tv_OnNodeExpand" BeforeClientClick="BeforeClientNodeClick"AfterClientClick="AfterClientNodeClick" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
You Click on the arrow image and it fires a java script function to show the div that contains the tree view.
This is probably rather old school since I should be able to use the item template of a rad combo.
I have an example that I'm trying to follow here. http://demos.telerik.com/aspnet/prometheus/TreeView/Examples/Functionality/TreeViewComboBox/DefaultCS.aspx
Seems simple enough but if the tree view is in the item template of the combo box, how can I get a reference to the tree view server side?
Also... Pretend that the rad tree view in that above sample is the ajax asp tree. When I expand the node on the ajax asp tree view, the validators on my page all fire and if not all satisfied then the expand will not complete. This was not happening with the classic tree. Any thoughts? It's triggering a full post back whereas the classic one did not?
I thought I might be able to leverage the before and after clicks: disable the validators before click. As it stands, however, the post back will occur after the after node click fires client side at which point I should be turning the validators back on in case they need to block the postback...
Regards.
We are using rad ajax panels in our system, and we are getting viewstate erros linked to the members clicking the back button in there browser.
Typical example.
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
This doesnt happen, when we dont use ajax. the member obviously see the login box again, but it doesnt error if they login.
what can we do to stop these viewstate errors while using ajax?