Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
335 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
110 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
233 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
112 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
71 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
246 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
1 answer
116 views
I have this editor on a page:

<telerik:RadEditor ID="editorPageContent" runat="server" EditModes="HTML"
Width="1000px" Height="550px" BorderStyle="None" Content='<%# Eval("PageContent") %>'
ToolsFile="~/Forms/EditorToolBar/SynopsisTools.xml" ContentFilters="None">
<ImageManager ViewPaths="~/PublicImages" UploadPaths="~/PublicImages" 
DeletePaths="~/PublicImages" EnableImageEditor="true" MaxUploadFileSize="20971520" />
<MediaManager  ViewPaths="~/PublicImages" UploadPaths="~/PublicImages" 
DeletePaths="~/PublicImages"  MaxUploadFileSize="20971520"/>
</telerik:RadEditor>

and when I upload this text:

<div class="hidden">
    <!-- Header -->
    <div id="header">
        <div class="area">
            <ul class="language">
                <li><a href="javascript:LoadPageContent('Home');"><img src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/UK.gif" alt="UK"/></a></li>
                <li><a href="javascript:LoadPageContent('HomeDE');"><img src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/germany.gif" alt="Germany"/></a></li>
            </ul>
        </div>
        <div class="relax"> </div>
        <div class="box">   
            <div class="area">
            <div class="title">
                <span class="gotham-bold">Mundipharma IT Services, Company launch</span>
                <span class="gotham-black">Winter 2011 | Wednesday 30 November to Friday 2 December</span>
            </div>
            <a href="#" class="logotype"><img src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/logotype.gif" alt="MITS Lauch"/></a>
            </div>
        </div>      
    </div>                                     
    <!-- Content -->
    <div id="content">
        <div class="area">
            <div class="main-pic">
                <div class="sidebar ">                      
                    <div class="pos-top"><h1><span>One vision.</span>Be a part of it.</h1></div>
                    <a href="#" class="pos-bottom"><img src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/mundi-pharma.png" alt="mundi pharma"/></a>                        
                </div>
                <div class="relax"> </div>
            </div>
            <div class="main-content">              
                <div class="quote">
                    <img src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/left-quote.gif" alt="left quote"/>
                    <span>From outdoor<br/>adventure to glitz and<br/>glamour, hold on tight<br/>as we take you on a<br/>winter wonderland<br/>journey through<br/>Switzerland</span>
                    <img src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/right-quote.gif" alt="right-quote"/> 
                    <div class="relax"> </div>
                </div>
                <div class="relax"> </div>
                <ul class="list">
                    <li><a href="javascript:LoadPageContent('FAQ');">Find out more about the event<span class="arrow"> </span></a></li>
                    <li><a href="javascript:openRadWinRegistration();">Register online now to attend the event<span class="arrow"> </span></a></li>
                    <li><a href="javascript:openRadWinDeclineInvite();">I cannot attend the event<span class="arrow"> </span></a></li>         
                </ul>           
            </div>
        </div>
    </div>
</div>

It is displayed as this:

<DIV class=hidden><!-- Header -->
<DIV id=header>
<DIV class=area>
<UL class=language>
<LI><A href="javascript:LoadPageContent('Home');"><IMG alt=UK src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/UK.gif"></A> 
<LI><A href="javascript:LoadPageContent('HomeDE');"><IMG alt=Germany src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/germany.gif"></A> </LI></UL></DIV>
<DIV class=relax> </DIV>
<DIV class=box>
<DIV class=area>
<DIV class=title><SPAN class=gotham-bold>Mundipharma IT Services, Company launch</SPAN> <SPAN class=gotham-black>Winter 2011 | Wednesday 30 November to Friday 2 December</SPAN> </DIV><A class=logotype href="#"><IMG alt="MITS Lauch" src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/logotype.gif"></A> </DIV></DIV></DIV><!-- Content -->
<DIV id=content>
<DIV class=area>
<DIV class=main-pic>
<DIV class="sidebar ">
<DIV class=pos-top>
<H1><SPAN>One vision.</SPAN>Be a part of it.</H1></DIV><A class=pos-bottom href="#"><IMG alt="mundi pharma" src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/mundi-pharma.png"></A> </DIV>
<DIV class=relax> </DIV></DIV>
<DIV class=main-content>
<DIV class=quote><IMG alt="left quote" src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/left-quote.gif"> <SPAN>From outdoor<BR>adventure to glitz and<BR>glamour, hold on tight<BR>as we take you on a<BR>winter wonderland<BR>journey through<BR>Switzerland</SPAN> <IMG alt=right-quote src="http://elenco.napp.co.uk/PublicImages/MITSLaunch/right-quote.gif"> 
<DIV class=relax> </DIV></DIV>
<DIV class=relax> </DIV>
<UL class=list>
<LI><A href="javascript:LoadPageContent('FAQ');">Find out more about the event<SPAN class=arrow> </SPAN></A> 
<LI><A href="javascript:openRadWinRegistration();">Register online now to attend the event<SPAN class=arrow> </SPAN></A> 
<LI><A href="javascript:openRadWinDeclineInvite();">I cannot attend the event<SPAN class=arrow> </SPAN></A> </LI></UL></DIV></DIV></DIV></DIV>

What is appears to have done is stripped out all the double quotes (") from all the class properties, which when I then insert the content into a web page causes the page not to work...

Any ideas?

Cheers
Cliff
Rumen
Telerik team
 answered on 05 Oct 2011
2 answers
311 views
Hi all,

We recently added 3 VMs  to our Sharepoint Farm and installed Sharepoint 2007 on each, so 2 are WFEs and 1 is the index. (Note: old VMs also had Sharepoint 2007, 2 WFE and 1 Index)

Now the problem we noticed is that the Calibri Font in the page template has disappeared from the drop down box in our sharepoint site.  I have added the following to the ToolsFile, but the radeditor version(4.5.6.0) is not picking up the Calibri Font.  Even when I remove the following from ToolsFile, i can still see the default fonts but not Calibri. Attached screenshot of the toolbar.

 <fontnames>
      <item name="Tahoma"/>
      <item name="Times New Roman"/>
      <item name="MS Sans Serif"/>
      <item name="Calibri"/>
      <item name="Verdana"/>
      <item name="Arial"/>
      <item name="Courier New"/>
    </fontnames>

I have also added the following to the CssEditor file (Note: this csseditor file i just copied from old farm)

BODY
{
    font-family:Calibri !important;
}


  I would really appreciate your help.  Thanks
Zack
Top achievements
Rank 1
 answered on 05 Oct 2011
5 answers
205 views
Hello,

I have a problem with RadComboBox control. In my project I have several of them with static Items list specified in aspx for each one. During the page load I'm supposed to set the selected item of those combo boxes according to data stored in a database (values of those radcomboboxes). This is where the problem begins. When I use RadComboBox.SelectedValue = somevalue; the radcombobox shows the Text of the 1st item in its list instead of the selected item's Text. If I click on the dropdown I can clearly see that for example a 3rd item in the list is selected but the actual Text value is coming from the 1st item in the list. Looking here: http://www.telerik.com/help/aspnet-ajax/combobox-items-server-side-code.html under SELECTING ITEMS it clearly says that I can select items using SelectedValue (which is the same behavior in standard ASP.NET controls) however RadComboBox gives me this issue which I'm not sure how to resolve.

Best regards.
Ivana
Telerik team
 answered on 05 Oct 2011
1 answer
134 views
I have a radgrid with all columns at template columns and grid is in editmode all the time. 
I need to capture row index changed event for each row so whenever user navigates from one row through other
I can validate existing row data before going to new row.
When I click through controls, onActiveRowChanged or onRowSelecting does not seem fire. How can I do that. Is there any client event to validate row
or something else like that.

Here is my client event markup on the grid.








   <ClientSettings Selecting-AllowRowSelect="true" KeyboardNavigationSettings-AllowActiveRowCycle="true">        <ClientEvents OnActiveRowChanged="RowChanged" OnRowSelected="RowChanged" />    </ClientSettings>










Mira
Telerik team
 answered on 05 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?