Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
149 views
I need to save the tools xml and css classes for the RadEditor in a database and the apply them to the editor based on which user is viewing.  I'm trying to use an HttpHandler to render the xml and css as follows:
                           
                            if (type == "tools") 
                            { 
                                context.Response.Clear(); 
                                context.Response.ContentType = "text/xml"; 
                                context.Response.Write(toolsXml); 
                            } 
                            else if (type == "css") 
                            { 
                                context.Response.Clear(); 
                                context.Response.ContentType = "text/css"; 
                                context.Response.Write(cssText); 
                            } 

In the above code, "toolsXml" and "cssText" are strings that contain the text from the database. 

Then code the editor as follows:

editor.ToolsFile = "~/ResourceHandler.ashx?mode=editor&type=tools";
editor.CssFiles.Add("~/ResourceHandler.ashx?mode=editor&type=css");

The editor throws an error when setting the ToolsFile property in this way, and just doesn't apply the css file at all.  How can I make the editor accept the handler as a valid xml or css url?

Thanks,
Matt



Rumen
Telerik team
 answered on 11 Nov 2009
5 answers
76 views
Hi All,

We have developed a membership based website that relies heavily on RadAjax. Over the last year we have encountered a few users having problems with pages using ajax. The users all seem to be using some corporate proxy.

I am just starting to investigate the problem. I'm guessing this has come up before.. But is this a general problem with proxies OR is there a security setting that these corporate entities have set that causes the errors?

Any insight is appreciated as i'm sure there are more of our users (current and gone) that are experiencing these problems and simple don't tell us.

Thanks!
Sebastian
Telerik team
 answered on 11 Nov 2009
3 answers
188 views
Hello

This is Karthik from Visual Consultancy Services in Bangalore. I have Some Issues in RadEditor.. Here i have my Source.

<table id=bnrH border=0 cellspacing=0 cellpadding=0 width="100%" align=center>
    <tbody>
        <tr>
            <td bgcolor=#900028 align=middle><!--START_LEVEL0_PAGE_HEADER-->&nbsp;
                <table border=0 cellspacing=0 cellpadding=5 width=771 align=center>
                    <tbody>
                        <tr>
                            <td valign=top width=77><a href="~/default.aspx" runat="server"><img border=0 alt="Fordham University The Jesuit University of New York" src="Images/logosubpage.gif"></a></td>
                            <td valign=top align=right><!--CMSQuickLinks--></td>
                        </tr>
                    </tbody>
                </table>
                <!--END_LEVEL0_PAGE_HEADER--></td>
        </tr>
     </tbody>
</table>


Note:
Here I attached two image file find out that.

Exp: Image 1 PatheError1.gif
Point No 1.
In my Source I used Commented Line ex:(<!--START_LEVEL0_PAGE_HEADER-->)
Point No 2:
the Same time i Used hyper link and Image tag Ex:(<a href="~/default.aspx" runat="server"><img border=0 alt="Fordham University The Jesuit University of New York" src="Images/logosubpage.gif"></a>)

Exp: Image2 PatheError2.gif
Here i face problem When i came to design Mode and I came  to Source Mode At the time I faced some problem i attached image its called patheerror2.jpg and i explained blow go through it

Point 1:
I used comment line mention  above
*Point2:
Point no 2 is getting Problem its Generating like this
<A href="http://localhost:3836/Tsunami/Clients/~/default.aspx" runat="server"><IMG alt="Fordham University The Jesuit University of New York" src="http://localhost:3836/Tsunami/Clients/Images/logosubpage.gif" border=0></A>

* its refering the Application Url See tha image and give me solution please

Point 3:
hyper link and Image tag Refering the Application Url

If you Have any Question feel free to ask.

Thanks & Regards
PL.Karthik





Rumen
Telerik team
 answered on 11 Nov 2009
3 answers
168 views
Hi,

I would like to run my own code in the OnEditCommand event for my Grid, but it always seems to
run the InPlace default form editing as well.  I am using GridButtonColumn, CommandName=Edit

I would like HeaderText = Edit, Link = Edit, and run my code in OnEditCommand event.

Eg.

Protected

 

Sub doEdit(ByVal Sender As Object, ByVal E As Telerik.Web.UI.GridCommandEventArgs)

 

 

If E.CommandName.ToUpper = "EDIT" Then

 

' -- run my code here

End If

 

 

End Sub

But as I said, the InPlace grid editing runs as well.  How do I disable this?

Cheers,
DGL

 

Martin
Telerik team
 answered on 11 Nov 2009
1 answer
87 views
Hello.

I can send parameters via OnClientCommand ?

example :

 Dim botaoEditar As DockCommand = New DockCommand
            botaoEditar.Name = "EDITAR"
            botaoEditar.Text = "editar"
            botaoEditar.AutoPostBack = True
            botaoEditar.OnClientCommand = "messagebox('fail')"

Pero
Telerik team
 answered on 11 Nov 2009
4 answers
1.4K+ views
Hi
       I upgraded .net 3.5 from .net 1.1 version, after that i installed Telerik control 2009.1.527.20 for my new project.Then  I added 

<%

@ Register Assembly="Telerik.Web.UI, Version=2009.1.527.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"  

 

Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 to my new form to work out telerik control. But i am facing the follwing issues
1) I cannot drag and drop the telerik control from tool box
2) suppose i  manually add control by code by griving tagprefix name like                                                                        <telerik:RadGrid ID="Grid1" runat="server"></telerik:RadGrid>
After i try to run the project i am getting the following error eventually. I dont know what is the reason

"The type or namespace name 'Telerik' could not be found in the global namespace (are you missing an assembly reference?) "

I tried 'gacutil' command tool to register the dll and also added the following block of code in web,config 

 

<

assemblies>

 

<

 

add assembly="Telerik.Web.UI, Version=2009.1.527.20, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/>

 

 

 

But no use...the error still comes...What step i need to be taken to avoid the foloowing issues.

-Thanks


 

 

 




 

 

 

 

John John
Top achievements
Rank 1
 answered on 11 Nov 2009
6 answers
278 views
Hello,

After much expermentation and searching through the forums,  I have figured out how to show a RadScheduler appointment with a RadDock.  This is triggered by the OnClientAppointmentClick.  I opted to use the clientside because the server side requires the Scheduler to be editable.  I only want folks in certain roles to have this ability.  The final goal is that when the general public clicks on an appointment, the details are loaded.  I prefer this over the common use of ToolTip.  I suppose I could have created two templates, one for viewing and one for editing, loading the appropriate one depending on the the user role.  I will probably use that, but is not the initial avenue I took.  I went down the path of client side and have succesfully implemented this using RadDock.   The one thing I did not like was that RadDock can not be modal without much tweaking.   Looking at what was involved to add this behaviour, I decided to use the RadWindow.  This decession has lead me here, as I have reached a stumbling block.   I am currently attempting to use the RadWindow as I did the RadDock by loading content dynamically by changing the DOM using innerHTML.   This was easy with RadDock, but not so with RadWindow.   I have played with multiple variations and have at least prevented the nasty object is null by first showing the window and then accessing the DOM.  That actually makes sense for first time load.  So now my script does not cause errors, but the content does not display?  I have attatched all the code so that people can see a working example of how to do this with RadDock.  I have only ommitted the SQLDataSource.   Please take a look at onAppointmentClick javascript function.  No errors but content is not loaded.   Perhaps this approach is not possible.   I know that it can easily be overcome by loading a seperate control in the window.  Overall that may be better, but I still want to see this work.  (PS.   The OnAppointmentClickDock function works.  For those who want to play simply change the event in the scheduler).

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="zzz.ascx.cs" Inherits="xxx.Modules.yyy.zzz" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
        <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">  
          
           <script type="text/javascript">   
           //<![CDATA[     
                
                function formatWeekName(rawDate)
                {
                   var dayofWeek = '';
                   switch (rawDate.getDay()) {
                      case 0:
                         dayofWeek = 'Sunday';
                         break;
                      case 1:
                         dayofWeek = 'Monday';
                         break;
                      case 2:
                         dayofWeek = 'Tuesday';
                         break;
                      case 3:
                         dayofWeek = 'Wednesday';
                         break;
                      case 4:
                         dayofWeek = 'Thursday';
                         break;
                      case 5:
                         dayofWeek = 'Friday';
                         break;
                      case 6:
                         dayofWeek = 'Saturday';
                         break;
                      default:
                         dayofWeek = '';
                   }
                   return dayofWeek;
                }
                
                function formatMonthName(rawDate) 
                {
                   var monthName = '';
                   switch (rawDate.getMonth()) {
                      case 0:
                         monthName = 'January';
                         break;
                      case 1:
                         monthName = 'February';
                         break;
                      case 2:
                         monthName = 'March';
                         break;
                      case 3:
                         monthName = 'April';
                         break;
                      case 4:
                         monthName = 'May';
                         break;
                      case 5:
                         monthName = 'June';
                         break;
                      case 6:
                         monthName = 'July';
                         break;
                      case 7:
                         monthName = 'August';
                         break;
                      case 8:
                         monthName = 'September';
                         break;
                      case 9:
                         monthName = 'October';
                         break;
                      case 10:
                         monthName = 'November';
                         break;
                      case 11:
                         monthName = 'December';
                         break;
                      default:
                         monthName = '';
                   }
                   
                   monthName = monthName + ' ' + rawDate.getDate();
                   return monthName;
                }
                function formatTime(rawDate)
                {
                   var hours = rawDate.getHours();
                   var minutes = rawDate.getMinutes();
                   var ampm;
                   
                   if (hours >= 12) {
                      hours -= 10;
                      ampm = " PM";
                   }
                   else {
                      ampm = " AM";
                   }
                   
                   if (minutes < 10) {
                      minutes = "0" +  minutes;
                   }
                   
                   return hours + ":" + minutes + ampm;
                }
                
                function onAppointmentClick(sender,eventArgs)
                {
                   var appointment = eventArgs.get_appointment()
                   var subject = appointment.get_subject();
                   var rawEndDate = appointment.get_end();
                   var rawStartDate = appointment.get_start();
                   
                   var endDateTime = formatWeekName(rawEndDate) + ", " + formatMonthName(rawEndDate) + " at " + formatTime(rawEndDate);
                   var startDateTime = formatWeekName(rawStartDate) + ", " + formatMonthName(rawStartDate)  + " at " + formatTime(rawStartDate);
                   
                   var fbtWin = $find("<%= RadWindow1.ClientID %>");
                   fbtWin.show();
                   fbtWin.get_contentFrame().contentWindow.innerHTML = "HELLO WORLD";
                   fbtWin.hide();
                   fbtWin.show();
                  
                }
                function onAppointmentClickDock(sender,eventArgs)
                {
                   var appointment = eventArgs.get_appointment()
                   var subject = appointment.get_subject();
                   var rawEndDate = appointment.get_end();
                   var rawStartDate = appointment.get_start();
                   
                   var endDateTime = formatWeekName(rawEndDate) + ", " + formatMonthName(rawEndDate) + " at " + formatTime(rawEndDate);
                   var startDateTime = formatWeekName(rawStartDate) + ", " + formatMonthName(rawStartDate)  + " at " + formatTime(rawStartDate);
                   
                   var dock = $find("<%= RadDock1.ClientID %>");
                   var viewPort = $telerik.getViewPortSize();
                   var xPos = Math.round((viewPort.width - parseInt(dock.get_width())) / 2);
                   var yPos = Math.round((viewPort.height - parseInt(dock.get_height())) / 2);                
                   $telerik.setLocation(dock.get_element(), { x: xPos, y: yPos });
                   
                   var content = dock.get_contentContainer();
                   content.innerHTML = "<table width='100%' border='0'><tr><td style=' font-weight:bolder'>Start:</td><td>" + startDateTime + "</td></tr><tr><td style=' font-weight:bolder'>End:</td><td>" + endDateTime + "</td></tr><tr><td style=' font-weight:bolder'>Description:</td><td>" + subject + "</td></tr></table>";   
                   dock.set_closed(false);
                }
 
 
            //]]> 
            </script> 
      </telerik:RadScriptBlock>    
        
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadScheduler1">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" /> 
                <telerik:AjaxUpdatedControl ControlID="RadDock1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
   
 
</telerik:RadAjaxManagerProxy>      
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" 
    Width="75px" Skin="WebBlue" Transparency="20">  
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
        style="border: 0px;" /> 
</telerik:RadAjaxLoadingPanel> 
    
<telerik:RadScheduler ID="RadScheduler1" runat="server" Height="460px"  OnClientAppointmentClick="onAppointmentClick" EnableEmbeddedScripts="True" 
    HoursPanelTimeFormat="htt" Skin="Outlook" ValidationGroup="ctl00_RadScheduler1" 
    DataSourceID="SqlDataSource1"   
    DataEndField="End"   
    DataKeyField="ID" 
    DataRecurrenceField="RecurrenceRule"   
    DataRecurrenceParentKeyField="RecurrenceParentID" 
    DataStartField="Start"   
    DataSubjectField="Subject" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound">  
</telerik:RadScheduler> 
 
<telerik:RadDock ID="RadDock1" runat="server" DockMode="Floating" Closed="true" Skin="Outlook"  Width="500px" Height="300px">  
<ContentTemplate> 
   
</ContentTemplate> 
</telerik:RadDock> 
<telerik:RadWindow ID="RadWindow1" runat="server" AutoSize="True" Modal="True" Skin="Vista" > 
</telerik:RadWindow> 
 
Svetlina Anati
Telerik team
 answered on 11 Nov 2009
4 answers
194 views
Hi,

I'm looking for two things,
1.  To change the font to century gothic.  Which actually fonts work?
2.  To change the font family for the whole chart in one place.

Any help would be great.
Ves
Telerik team
 answered on 11 Nov 2009
5 answers
113 views

Hi,

Using RadControls for ASP.NET AJAX version 2007.3 1425 (Feb 25, 2008) and Internet Explorer 7 (version 7.0.5730.13), I am trying to paste a flash element in the RadEditor with the following clientside script:
    var ieFilter = editor._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
    var ffFilter = editor._filtersManager.getFilterByName("MozillaKeepFlashString");
    if (ieFilter) strXhtml = ieFilter.getDesignContent(strXhtml);
    if (ffFilter) strXhtml = ffFilter.getDesignContent(strXhtml);
    editor.pasteHtml(strXhtml);

Before this code is executed, the strXhtml variable contains the following xhtml:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash"><param name="movie" value="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557"></param><param name="quality" value="high"></param><param name="bgcolor" value="#FFFFFF"></param><embed src="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557" quality="high" bgcolor="#FFFFFF" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer"></embed></object>

The string that is passed to the pasteHtml method contains the following:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash"><rade_param name="movie" value="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557"></rade_param><param name="movie" value="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557"></param><rade_param name="quality" value="high"></rade_param><param name="quality" value="high"></param><rade_param name="bgcolor" value="#FFFFFF"></rade_param><param name="bgcolor" value="#FFFFFF"></param><embed src="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557" quality="high" bgcolor="#FFFFFF" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer"></embed></object>

After this html is pasted I switch to html mode where I see the following:
<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" height="100" width="100" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" xlink:title="Testflash" xlink:href="8-165-o" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" href="null">
<param name="movie" value="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF"><embed src="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557" quality="high" bgcolor="#FFFFFF" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer"></embed></object>

When I postback the page and access the RadEditor's Content property this contains the same (except that the order of some attributes is different).

I see several differences between the content I originally pasted and the content that is posted:
- the title="" attribute has been removed from the <object> element (not a big problem).
- a href="null" attribute has been added to the <object> element (not a big problem though I doubt that this is comform the xhtml specification).
- the <param> tags are no longer closed. This is a problem since the content is not valid xhtml anymore, and I cannot parse it with an xml parser (which I need to do).

How can I solve this issue? Thanks for any help!

Rumen
Telerik team
 answered on 11 Nov 2009
1 answer
136 views
Hello,

I have page which contains only a radgrid. This page is displayed through the following radwindow.
 <telerik:RadWindow ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" 
                                NavigateUrl="../Client/ForecastsSelect.aspx" runat="server" ID="wndForecastSelect" Modal="true" 
                                AutoSize="true" Animation="FlyIn" OnClientClose="OnForecastClose" Behaviors="Close"> 
                            </telerik:RadWindow> 

The grid in the popup page:
        <telerik:RadGrid runat="server" DataSourceID="SqlDataSource1" GridLines="None"  
            ShowGroupPanel="True" AllowPaging="True"> 
<MasterTableView datasourceid="SqlDataSource1"> 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
</MasterTableView> 
            <clientsettings allowdragtogroup="True"> 
            </clientsettings> 
        </telerik:RadGrid> 


If I set ShowGroupPanel to false on the grid, the window is well resized. But if the ShowGroupPanel is set to true, there is an extra blank area at the bottom of the window. You can see it in attachments.

Do you have a fix for that?

best regards,

Laurent


Svetlina Anati
Telerik team
 answered on 11 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?