Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
55 views
I've tried to use:

http://www.telerik.com/community/forums/aspnet-ajax/combobox/validate-user-input-in-radcombobox-with-allowcustomtext-quot-true-quot-filter-quot-contains-quot.aspx

however, the javascript never fires. I've debugged in the browser and the javascript is never called. The requirefield validator works fine, but if a user tpyes somejunk into the filter and presses 'ok' without selecting an item, the form accepts the input, writes to teh database and closes the modal form.
I've included the AdvancedInsertTemplate of the RadScheduler below.

<AdvancedInsertTemplate>
            <div class="rsAdvancedEdit rsAdvancedModal"
               style="position: relative; width:560px; left: 30%;">
               <div class="rsModalBgTopLeft">
               </div>
               <div class="rsModalBgTopRight">
               </div>
               <div class="rsModalBgBottomLeft">
               </div>
               <div class="rsModalBgBottomRight">
               </div>
               <div class="rsAdvTitle">
                  <h1 class="rsAdvInnerTitle">
                     <%#Container.Appointment.Owner.Localization.AdvancedNewAppointment%>
                  </h1>
                  <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false"
                     CommandName="Cancel" CssClass="rsAdvEditClose"
                     ToolTip="<%# Container.Appointment.Owner.Localization.AdvancedClose %>"> <%#Container.Appointment.Owner.Localization.AdvancedClose%></asp:LinkButton>
 
               </div>
               <div class="rsAdvContentWrapper">
                  <div style="display: inline-block">
                     <!-- ** -->
                     <div style="float: left;">
                        <p>
                           <telerik:RadComboBox ID="UsersComboBox" runat="server" DataSourceID="UsersDataSource" DataTextField="Fullname" DataValueField="Username"  AllowCustomText="true" EnableTextSelection="false" EmptyMessage="Please select..." Filter="Contains"
                              Label="User" SelectedValue='<%# Bind("Username") %>'>
                           </telerik:RadComboBox>
                           <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="UsersComboBox" runat="server" ErrorMessage="Required"></asp:RequiredFieldValidator>
                           <asp:CustomValidator ID="CustomValidator331" runat="server"
                              ControlToValidate="UsersComboBox"
                               ClientValidationFunction="validateCombo" ValidateEmptyText="true"
                               ErrorMessage="You cansubmit only existing name">
                                 
                           </asp:CustomValidator>
                        </p>
                        <p>
                           <div style="display: inline-block">
                              <div style="float: left; width: 76px; text-align: right; padding-right: 5px; padding-top: 5px;">
                                 <asp:Label ID="Label1" runat="server" ForeColor="#333333" Text="Start"></asp:Label>
                              </div>
                              <div>
                                 <telerik:RadDateTimePicker ID="StartInput" runat="server" Culture="en-NZ"
                                    SelectedDate='<%# Bind("Start") %>'>
                                    <TimeView CellSpacing="-1" Culture="en-NZ" EndTime="17:30:00"
                                       Interval="00:30:00" RenderDirection="Vertical" StartTime="08:30:00">
                                    </TimeView>
                                    <TimePopupButton HoverImageUrl="" ImageUrl="" />
                                    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                       ViewSelectorText="x">
                                    </Calendar>
                                    <DateInput DateFormat="d/MM/yyyy" DisplayDateFormat="d/MM/yyyy">
                                    </DateInput>
                                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                 </telerik:RadDateTimePicker>
                              </div>
                           </div>
                        </p>
                        <p>
                           <div style="display: inline-block">
                              <div style="float: left; width: 76px; text-align: right; padding-right: 5px; padding-top: 5px;">
                                 <asp:Label ID="Label2" runat="server" ForeColor="#333333" Text="End"></asp:Label>
                              </div>
                              <div>
                                 <telerik:RadDateTimePicker ID="EndInput" runat="server" Culture="en-NZ"
                                    SelectedDate='<%# Bind("End") %>'>
                                    <TimeView CellSpacing="-1" Culture="en-NZ" EndTime="17:30:00"
                                       Interval="00:30:00" RenderDirection="Vertical" StartTime="08:30:00">
                                    </TimeView>
                                    <TimePopupButton HoverImageUrl="" ImageUrl="" />
                                    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                       ViewSelectorText="x">
                                    </Calendar>
                                    <DateInput DateFormat="d/MM/yyyy" DisplayDateFormat="d/MM/yyyy">
                                    </DateInput>
                                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                 </telerik:RadDateTimePicker>
                              </div>
                           </div>
                        </p>
                        <p>
                           <div style="display: inline-block">
                              <div style="float: left; width: 76px; text-align: right; padding-right: 5px; padding-top: 5px;">
                                 <asp:Label ID="Label3" runat="server" ForeColor="#333333" Text="Permanent"></asp:Label>
                              </div>
                              <div>
                                 <asp:CheckBox ID="chkPerm" runat="server" />
                                 <asp:HiddenField ID="hidPerm" runat="server" Value='<%# Bind("Perman") %>' />
                              </div>
                           </div>
                        </p>
                        <p>
                           <telerik:RadComboBox ID="StatusComboBox" runat="server"
                              DataSourceID="StatusDataSource" DataTextField="Status"
                              DataValueField="StatusId" Label="Status"
                              SelectedValue='<%# Bind("StatusId") %>' Visible="false">
                           </telerik:RadComboBox>
                        </p>
                     </div>
                     <!-- ** -->
                     <div>
                        <telerik:RadTextBox ID="DescriptionTextBox" runat="server" Columns="30"
                           Label="Notes" Rows="4" Text='<%# Bind("Description") %>' TextMode="MultiLine">
                        </telerik:RadTextBox>
                     </div>
                  </div>
                  <asp:Panel ID="Panel1" runat="server" CssClass="rsAdvancedSubmitArea">
                     <div class="rsAdvButtonWrapper">
                        <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Insert"  CausesValidation="true"
                           CssClass="rsAdvEditSave"> <span><%# Container.Appointment.Owner.Localization.Save%></span></asp:LinkButton>
                        <asp:LinkButton ID="CancelButton" runat="server" CausesValidation="false"
                           CommandName="Cancel" CssClass="rsAdvEditCancel">
                           <span><%# Container.Appointment.Owner.Localization.Cancel%></span>
                           </asp:LinkButton>
 
                         
                     </div>
                  </asp:Panel>
               </div>
            </div>
         </AdvancedInsertTemplate>
Ivana
Telerik team
 answered on 05 Oct 2011
3 answers
128 views
Hi,

We are using the  version 2011.2.712.40 of telerik.
I want to prevent the postback of a radtoolbar with an OnClientButtonClicked to open a RadWindow.
I use e.set_cancel(true); but i receive always a javascript error : Error: Object doesn't support property or method 'set_cancel'

Any idee what is this probleem ?

In advance thanks.

Edwin.
Kate
Telerik team
 answered on 05 Oct 2011
2 answers
65 views
I have three related comboboxes inside a grid row, I need to have the selectedindexchanged fire a second time but it will not for the second combo box.  thx.
Dimitar Terziev
Telerik team
 answered on 05 Oct 2011
2 answers
175 views
Hi guys!
First of all to clarify that I am using Telerik.Web.UI  v. 2011.1.413.40, so it may be addressed already in the newer versions. I am doing some Sitefinity development, that's why I am using that version of the controls.
The problem is that hidden fields are really hidden ;) in the editor when used under IE 9, while they show up in IE versions lower than 9 and are selectable in the Editor design view. Not really a big deal, can you tell me if this is addressed and the hidden fields are shown in some of the newer versions of the editor under IE 9 or not?

If they are I'll not bother to search for workaround (my release will probably fall after the Q3 release so I think I'll be using pretty new version of the controls if Sitefinity include it). 

Refer to the screenshots for examples.
I am starting off with a blank HTML with only
<input type="hidden" value="test"></input>

In IE 9 as you can see the editor design surfice is blank, while the hidden field is correctly displayed and selectable in lower versions.
Once again it is not a big deal and once again - I just want to know if this is addressed or will be addressed (seems very low priority but it may appear important to my project).
Power
Top achievements
Rank 2
 answered on 05 Oct 2011
5 answers
257 views
I have a requirement to fire a client side event on Telerik RadGrid Row Double Click, and an update fetching from server on single click. But Double click event doesn't work. If I remove "EnablePostBackOnRowClick" option, then it works fine. How can I use both? Here is my code

<ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="false" AllowDragToGroup="false"
     
AllowColumnsReorder="false" EnablePostBackOnRowClick="true" >
     
<ClientEvents OnRowDblClick="RowDblClick" />                  
 
</ClientSettings>
Stuart Hemming
Top achievements
Rank 2
 answered on 05 Oct 2011
1 answer
77 views
Hi!

I know how to add my own localized texts for editor's toolbar in the code-behind, but how do I do it for LinkManager dialogbox? I'd like to use my own database and custom ResourceProviderFactory.

Example how I do it for toolbar:

Dim editor As New Telerik.Web.UI.RadEditor
editor.EditModes = EditModes.Design
Dim toolGroup As New Telerik.Web.UI.EditorToolGroup
editor.Tools.Add(toolGroup)
Dim bold As New Telerik.Web.UI.EditorTool
bold.Name = "Bold"
bold.Text = HttpContext.GetGlobalResourceObject("Global", "editorBold")
toolGroup.Tools.Add(bold)
Rumen
Telerik team
 answered on 05 Oct 2011
1 answer
144 views

Hi,
  I implemented a treeview using webservice in a web page and it worked ok. the treeview is simple as follows:                      

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CategoryTreeView.aspx.cs" Inherits="iBOOKSTORE.CategoryTreeView" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
   
 
                <telerik:RadTreeView ID="tvClass" runat="server" Height="400px" Width="500px"
                      Skin="Windows7" CheckBoxes="True" CheckChildNodes="True">
                    <WebServiceSettings Path="CategoryTreeView.aspx" Method="GetClassItems" />
                </telerik:RadTreeView>
     
    </div>
    </form>
</body>
</html>

   
the webmethod "GetClassItems" worked fine.
but when I convert it into a usercontrol like the following:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserTreeView.ascx.cs" Inherits="iBOOKSTORE.UserTreeView" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
    <div>
   
                <telerik:RadTreeView ID="tvClass" runat="server" Height="400px" Width="500px"
                      Skin="Windows7" CheckBoxes="True" CheckChildNodes="True">
                    <WebServiceSettings Path="UserTreeView.ascx" Method="GetClassItems" />
                </telerik:RadTreeView>
     
    </div>

there is no difference between server side Methods. And I drag this usercontrol  "UserTreeView.ascx" and drop it on a web page at the same directory. The treeview loaded ok by calling a server side function which returned a datatable. but when I click open a node, an error message popped up "GetClassItems Failed". I tried to set a break point in the WebMethod "GetClassItems", the execution never got inside. I suppose this must have something to do with the Path property. I purposely place the host page and usercontrol in the same directory, but no matter what I tried the same error occured. could you provide some advice please. 
Thank you.
I send the server side code as well

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Web.Services;
using Telerik.Web.UI;
using System.Web.UI.HtmlControls;
 
namespace iBOOKSTORE
{
    public partial class UserTreeView : System.Web.UI.UserControl
    {
        static DataTech.AspNet.Data.dtAspNetDataSource ds = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ds = new DataTech.AspNet.Data.dtAspNetDataSource();
                LoadRootNodes(tvClass, TreeNodeExpandMode.WebService);
            }
        }
 
        private static void LoadRootNodes(RadTreeView treeView, TreeNodeExpandMode expandMode)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "SELECT DPTCODE,DPTNAME FROM DEPARTMENT WHERE LEFT(DPTCODE,1) <>'-' ORDER BY DPTCODE ";
            cmd.CommandTimeout = 0;
 
 
            DataTable data = GetData(cmd);
 
            foreach (DataRow row in data.Rows)
            {
                RadTreeNode node = new RadTreeNode();
                node.Text = row["DPTNAME"].ToString();
                node.Value = row["DPTCODE"].ToString();
                node.ExpandMode = expandMode;
                treeView.Nodes.Add(node);
            }
        }
 
        private static DataTable GetData(SqlCommand sqlcmd)
        {
            return (ds.GetDataRows(sqlcmd, "", "", 0, int.MaxValue));
        }
 
        private static DataTable GetChildNodes(string parentId)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.Text;
 
            cmd.CommandText = "SELECT SUBSTRING(pc1.CLSCODE,1," + (parentId.Trim().Length + 1).ToString() + ") AS PCODE,pc1.PCODE,pc1.CLSCODE,pc1.CLSNAME,ISNULL(pc2.ChildrenCount, 0) as ChildrenCount FROM CLASS AS pc1 " +
                " LEFT JOIN ( SELECT PCODE, COUNT(*) AS ChildrenCount FROM CLASS GROUP BY PCODE) AS pc2" +
                " ON SUBSTRING(pc1.CLSCODE,1," + (parentId.Trim().Length + 1).ToString() + ")=pc2.PCODE WHERE pc1.PCODE='" + parentId.Trim() + "'";
 
 
            cmd.CommandTimeout = 0;
            return GetData(cmd);
        }
 
 
 
 
        private void UpdateLoadingStatusPosition(TreeViewLoadingStatusPosition statusPosition)
        {
 
            tvClass.LoadingStatusPosition = statusPosition;
        }
 
 
        [WebMethod]
        public static RadTreeNodeData[] GetClassItems(RadTreeNodeData node)
        {
 
            DataTable data = GetChildNodes(node.Value);
 
            List<RadTreeNodeData> result = new List<RadTreeNodeData>();
            foreach (DataRow row in data.Rows)
            {
 
                RadTreeNodeData childNode = new RadTreeNodeData();
                childNode.Text = row["CLSNAME"].ToString();
                childNode.Value = row["PCODE"].ToString();
                if (Convert.ToInt32(row["ChildrenCount"]) > 0)
                {
                    childNode.ExpandMode = TreeNodeExpandMode.WebService;
                }
                result.Add(childNode);
            }
 
            return result.ToArray();
        }
 
 
    }
}

 

Dimitar Terziev
Telerik team
 answered on 05 Oct 2011
2 answers
89 views
Hi,

As the title, our client don't have the need to do HTML coding, those features will seems to be complicated for them.
How could I disable them so that I can get a text Editor looks simply just like this one I am typing in?

Thanks
Derrick
Top achievements
Rank 1
 answered on 05 Oct 2011
2 answers
33 views
Hello,

I have a web part which contains RadPanelBar.Inside it there are many RadPanelItem.One of my RadPanelItem contains a FileUpload(ASP.Net file upload) control and also a button to submit it after browsing the image.I have used RadAjaxManager,but the page refresh and also i am not getting the HasFile property of FileUpload control at server side. Please give the solution for this problem.

Thanks
Er.Velkumar
Maria Ilieva
Telerik team
 answered on 05 Oct 2011
1 answer
174 views
I have a hierarchical grid with a nestedview template in one of the child grids. A couple of the grids have a cascading combo, where one combo triggers a postback so that the second combo can be populated with new data. The problem I have is that I'm getting a

"Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."


error when the selected item of the first combo is changed.

I've looked around but haven't found the solution yet. I've had this issue before but can't remember how I solved it (or even if I did). I'm wondering in this instance if it's a RadGrid-specific issue. One option will be to handle the postback and repopulation (I'm assuming that it's the combos that are causing the problem) programmatically but I'm not sure how to do that when the combos are in an editform or in a grid contained in a nestedview template.

Jayesh Goyani
Top achievements
Rank 2
 answered on 05 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?