Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
154 views
Hi

There is a bar at the bottom of the editor (edit: just discovered it is the dominspector) which will display the name of the element and allow you to select or remove the element from the content.

Is it possible to change the behavior of the dom inspector?  For example, right now if you click on the name of the element it will select it for you.  I would like to add some javascript which will not only select the text but also pop up a tooltip that will display the attributes which I have assigned to that element.  I am able to parse out the attribute, but am not sure how to trigger the javascript via the Tag Inspector. 

There is another bar called the property inspector... Is it possible to use that bar to display the text instead of using a tooltip?

Update 1
-------------------------
I found a sample of creating a custom module, which is the way that I think I would go about implementing my request. 
The dom inspector is so close to doing what I want, I want to remove an element (and add a confirm before I do remove it), and want to select the tag the way that you do via the tag inspector, I just need to add a bit of custom code so that I can display one of the attributes that I'm assigning to the tag
Is there a way to get the javascript that you use to do the work of the dom inspector?  I could then just add my code to it, and create my own custom module to do it all in.

Update 2
-------------------------
I think I would be able to do what I needed to do if there was a way to get the index of the selected element when I click on it in the editor.  The dom inspector is able to determine which element is under the cursor, as it displays the element as a hyperlink that you can click on in order to select the entire element, so there must be a way to get that index. 

Is this possible?

Update 3
------------------------
Figured it out.  Code attached
    MyModule = function(element) {  
        MyModule.initializeBase(this, [element]);  
    }  
 
    MyModule.prototype = {  
        initialize: function() {  
            MyModule.callBaseMethod(this, 'initialize');  
            var selfPointer = this;  
            this.get_editor().add_selectionChange(function() { selfPointer.showComment(); });  
        },  
 
        //A method that does the actual work - it is usually attached to the "selection changed" editor event  
        showComment: function() {  
            var span = document.createElement("SPAN");  
            var selectedElement = this.get_editor().getSelectedElement();  
            var element = this.get_element();  
            element.innerHTML = "<b>" + selectedElement.nodeNname + ":</b>";  
 
            switch (selectedElement.nodeName) {  
                case "comment":  
                    element.innerHTML += selectedElement.attributes["value"].value;  
                    break;  
                default:  
                    element.innerHTML = "";  
                    break;  
            }  
 
            element.style.borderTop = "1px solid red";  
            element.style.color = "red";  
            element.style.height = "100";  
            element.style.borderRight = "1px solid lightblue";  
            element.style.borderLeft = "1px solid lightblue";  
            element.style.borderBottom = "1px solid lightblue";  
        }  
    };  
      
    MyModule.registerClass('MyModule', Telerik.Web.UI.Editor.Modules.ModuleBase);  
 
Dobromir
Telerik team
 answered on 15 Feb 2010
2 answers
147 views
Hello,

I need to rotate several user controls using a rotator. I do not have anything in the markup and the user control have different output, so using the ItemTemplate is not possible.
I have tried creating RadControlItem object and setting the value of the DataItem property to the control i want to render, but nothing gets displayed on screen.
How can i pass a collection of Controls (user controls) to the rotator?

I am using Telerik Q3 2009.

Thank you,
Adrian.
Adrian
Top achievements
Rank 2
 answered on 15 Feb 2010
1 answer
56 views
Hi,

I created a custom class and implemented the FileBrowserContentProvider.
Reading my file from my imagebank is no problem, I can insert them in the editor and displays fine.

The problem comes when I want to upload a new image, it always comes with the notification 'A file with a name same as the target already exists!'. And there is no file with the same name.. When I check the overwrite checkbox, it works like a charm..

Is it possible to disable/override the FileExists check or check the checkbox and hide it? Or can I solve it any other way?

Thanks in advance!
Wesley
Top achievements
Rank 1
 answered on 15 Feb 2010
1 answer
91 views
So, is there a javascript method that allows me to load an xml string into a radcombobox?

Thanks!
Yana
Telerik team
 answered on 15 Feb 2010
1 answer
101 views
HI

I am using Rad Grid to display some data, i am running the site from  from a virtual directory, the grid loads fine but i cannot edit, delete or create new rows. after clicking on the edit link it just loads forever and nothing happens. Please assist me. it works fine if it';s not been run from a virtual directory.
Radoslav
Telerik team
 answered on 15 Feb 2010
9 answers
432 views

Hi,

Environment:
- Windows Vista with Service Pack1
- IIS 7
- RadControls for ASP.NET AJAX Q2 2009 NET35
- MS Visual Studio 2008

Error Message in Visual Studio Design Page:

 

Error Rendering Control - RadScriptManager1An unhandled exception has occurred.

Could not load file or assembly 'Telerik.Web.UI, Version=2009.2.701.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The system cannot find the file specified.

_______________________________________________________________________________

I am creating a simple Website with just 1 page. Getting the above error message. I also can't register Telerik.Web.UI.WebResource.AXD from Visual Design Page because RadScriptManager Show Smart Tag is dimmed out, like read only.. In my Web Config File, I followed the instructions to register HTTPHandler from this Page.

http://www.telerik.com/help/aspnet-ajax/radscriptmanager.html

Below is my WEB Config, Default.aspx and Code Behind File. Please help. Thanks
________________

Web Config:

 


 

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
 <configSections>
  <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
   <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
     <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
     <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
     <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
     <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    </sectionGroup>
   </sectionGroup>
  </sectionGroup>
 </configSections>
 <appSettings/>
 <connectionStrings/>
 <system.web>
  <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
  <compilation debug="false">
   <assemblies>
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
  </compilation>
  <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
  <authentication mode="Windows"/>
  <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
  <pages>
   <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   </controls>
  </pages>
  <httpHandlers>
   <remove verb="*" path="*.asmx"/>
   <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
  </httpHandlers>
  <httpModules>
   <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  </httpModules>
 </system.web>
 <system.codedom>
  <compilers>
   <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="WarnAsError" value="false"/>
   </compiler>
   <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="OptionInfer" value="true"/>
    <providerOption name="WarnAsError" value="false"/>
   </compiler>
  </compilers>
 </system.codedom>
 <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
 <system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  <modules>
   <remove name="ScriptModule"/>
   <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  </modules>
  <handlers>
   <remove name="WebServiceHandlerFactory-Integrated"/>
   <remove name="ScriptHandlerFactory"/>
   <remove name="ScriptHandlerFactoryAppServices"/>
   <remove name="ScriptResource"/>
   <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   <add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2009.2.701.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
  </handlers>
 </system.webServer>
 <runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
   <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
   </dependentAssembly>
   <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
   </dependentAssembly>
  </assemblyBinding>
 </runtime>
</configuration>

_________________

Defult.aspx

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ 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">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
    </div>
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    </form>
</body>
</html>

____________
Code Behind:

 

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}

 

 

 

n gh
Top achievements
Rank 1
 answered on 15 Feb 2010
7 answers
134 views
Hi there,

I have the following scenario:

8 Editors on a page which all use the same Toolbar, so I implemented ToolProviderID so that all Editors use the Toolbar off the first Editor.

The toolbar is shown properly exept for the <symbols> section which shows the default list and not my custom defined list in the toolbar XML.

Any suggestions?

Marc
Debbie Roberts
Top achievements
Rank 1
 answered on 15 Feb 2010
1 answer
122 views
Hi Everybody,

I would like to crete new node on clientside and set this node to edit mode. And when user doesn't change the label and click outside, i would like show radalert and cancel postback -  so far so good. But after that I would like to set node to edit mode again. And I'm getting strange unhanded exceptions from code. This is my snippet:


function onClientNodeEditing(sender, eventArgs) { 
                var node = eventArgs.get_node(); 
                var oldText = node.get_text(); 
                var newText = eventArgs.get_newText() 
                var tree = $find("<%= ThreadRoot.ClientID %>"); 
                 
                if (newText == oldText) { 
                    radalert(Please change name of category!"); 
                    
                    tree.trackChanges(); 
                    node.startEdit(); 
                    tree.commitChanges(); 
 
 
                    eventArgs.set_cancel(true); 
                } 
            } 

Any ideas? for example this code returns Cannot set property 'onblur' of null (G Chrome) and stops execution with Uncaught RangeError, Maximum call stack size exceeded
Yana
Telerik team
 answered on 15 Feb 2010
3 answers
188 views
Im trying to create a dock zone, with 5 docks, and orientation horizontal, its a priority like utility, whats in the left its more important.

Problems:

    I cant set the height of each dock, another controls will be added inside. But, in firefox, these docks get very big. To reproduce this you just need a docklayout, a dockzone (no height), 2 docks inside (no height), and orientation horizontal. The docks dont feet to the content inside, but to the page height size (??). A workaround its to change the dock height when adding controls, but its very boring to do, im not sure how many text will come from database, and im not using a monospace font.

    I do need a space between each dock, what im trying to get adding a padding in the raddock_custom, and it works very bad, first because IE draw the help lines with padding, around and far from the dock, and FF seems to be adding the padding to the help lines and the virtual dock size each time a control is dragged around.

    In a dockzone without any width, the help lines dont show, and becomes impossible to drag docks, except the last one.

If anyone can point me a direction to solve these problems i ll be very glad.

Regards
Pero
Telerik team
 answered on 15 Feb 2010
1 answer
189 views
Hi guys.
here is my sqlcommand Code
<asp:SqlDataSource ID="SqlDataSource1" runat="server"  
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>"  
          
            SelectCommand="SELECT AppointmentID, Start, [End], Subject, Due, Priority, UserID FROM Appointments_DragAndDrop WHERE (Start IS NOT NULL) AND ([End] IS NOT NULL) AND (UserID = @UserID)" 
            InsertCommand="INSERT INTO Appointments_DragAndDrop(Subject, Start, [End], UserID) VALUES (@Subject, @Start, @End , @UserID)" 
            UpdateCommand="UPDATE [Appointments_DragAndDrop] SET [Start] = @Start, [End] = @End, [Subject] = @Subject WHERE AppointmentID = @AppointmentID" 
             
             
            DeleteCommand="DELETE FROM [Appointments_DragAndDrop] WHERE [AppointmentID] = @AppointmentID"> 
            <InsertParameters> 
                <asp:Parameter Name="Subject" Type="String" /> 
                <asp:Parameter Name="Start" Type="DateTime" /> 
                <asp:Parameter Name="End" Type="DateTime" /> 
                <asp:Parameter Name="UserID"   /> 
            </InsertParameters> 
            <UpdateParameters> 
                <asp:Parameter Name="Start" Type="DateTime" /> 
                <asp:Parameter Name="End" Type="DateTime" /> 
                <asp:Parameter Name="Subject" Type="String" /> 
                <asp:Parameter Name="AppointmentID" Type="Int32" /> 
            </UpdateParameters> 
            <SelectParameters> 
                <asp:SessionParameter DefaultValue="" Name="UserID" SessionField="UserID" /> 
            </SelectParameters> 
            <DeleteParameters> 
                <asp:Parameter Name="AppointmentID" Type="Int32" /> 
            </DeleteParameters> 
        </asp:SqlDataSource> 
And here is code behinde
 private void HandleSchedulerDrop(int id, string subject, string targetSlotIndex) 
    { 
        RadScheduler1.Rebind(); 
 
        ISchedulerTimeSlot slot = RadScheduler1.GetTimeSlotFromIndex(targetSlotIndex); 
 
        TimeSpan duration = TimeSpan.FromHours(1); 
        if (slot.Duration == TimeSpan.FromDays(1)) 
        { 
            duration = slot.Duration; 
        } 
        
        ScheduleAppointment(id, subject, slot.Start, slot.Start.Add(duration), Session["UserID"].ToString()); 
    } 
 
    private void ScheduleAppointment(int id, string subject, DateTime start, DateTime end,string UserID) 
    { 
        IDataSource dataSource = SqlDataSource1; 
        DataSourceView view = dataSource.GetView("DefaultView"); 
 
        IOrderedDictionary data = new OrderedDictionary(); 
        data.Add("Subject", subject); 
        data.Add("Start", start); 
        data.Add("End", end); 
        data.Add("UserID", UserID); 
 
        IDictionary keys = new OrderedDictionary(); 
        keys.Add("AppointmentID", id); 
      
        view.Update(keys, data, new OrderedDictionary(), OnDataSourceOperationComplete); 
        
    } 
 
    private static bool OnDataSourceOperationComplete(int count, Exception e) 
    { 
        if (e != null) 
        { 
            throw e; 
        } 
        return true; 
    } 
How ican Insert? Insert occure right and okey! but UserID field is null!?
how i can fill UserID column in database with Session?
(Update Select and Delete Is absolutely okey)
tnx guys
Peter
Telerik team
 answered on 15 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?