Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
118 views
Using various help articles I've read on this site, I've overridden the Image Manager dialogue in my Editor, and for the most part it seems to work, in that the selected image is placed into my text editor correctly, but then clicking on the newly placed image (left or right click), or selecting it using the keyboard, gives me an error.  By the looks of things, focusing on the image is what triggers it. I don't have any interest in passing the selected image back to the image mamager, or providing context menu support, only perhaps to be able to cut/paste the image tag that it generated.

Webpage error details:


User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB5; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; WWTClient2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Wed, 12 Aug 2009 15:59:46 UTC

Message: 'top' is null or not an object
Line: 2255
Char: 1
Code: 0
URI: http://localhost/myproject/ScriptResource.axd?d=hpeMsrj0DJn-Q2ateRZcjsIrr_IeFTKdapS0Cz_SmT0NhhOD6wbIAdPCt04I7VrGdieSBHWkP2PpIWSzPTrQig2&t=7dfff488

My code so far is that I have a radEditor inside a usercontrol, which sits inside a radPageView, which is defined in my default.aspx page

                <telerik:RadEditor
                    ID="AbstractContent"
                    runat="server"
                    ToolsFile="xml/advancedtoolsfile.xml"
                    Skin="Telerik"
                    AutoResizeHeight="false"
                    EnableResize="false"
                    Width="800"                     
                >
                <ContextMenus>
                    <telerik:EditorContextMenu TagName="IMG" Enabled="false" />
                </ContextMenus>                  
                </telerik:RadEditor>

                <script type="text/javascript">
                    Telerik.Web.UI.Editor.CommandList["ImageManager"] = function(commandName, editor, args) {
                        var elem = editor.getSelectedElement(); //returns the selected element.

                        if (elem.tagName == "IMG") {
                            editor.selectElement(elem);
                            argument = elem;
                        }
                        else {
                            var img = editor.get_document().createElement("IMG");
                            argument = img;
                        }

                        var myCallbackFunction = function(sender, args) {
                            editor.pasteHtml(String.format("<img src='{0}' title='{1}' alt='{2}' />", args.src, args.altText, args.altText))
                        }

                        editor.showExternalDialog(
                            'InsertMedia.aspx',
                            argument,
                            900,
                            500,
                            myCallbackFunction,
                            null,
                            'Insert Image',
                            true,
                            Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                            false,
                            false);
                    };
                    </script>

with my InsertMedia.aspx page having a gridview that allows a user to sort/filter a database managed image collection, with this small block of javascript underneath:

    <script type="text/javascript">
        function getRadWindow() {
            if (window.radWindow) {
                return window.radWindow;
            }
            if (window.frameElement && window.frameElement.radWindow) {
                return window.frameElement.radWindow;
            }
            return null;
        }
    </script>

and the InsertMedia.aspx.cs having the following, which occurs when the "select" server side event fires in my dialogue window:

System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(
"var workImage = getRadWindow().ClientParameters;");
sb.Append(String.Format(
"workImage.src = '{0}{1}';", GetMediaRootWebPath(), SelectedMediaContent.UrlPrimary));
sb.Append(String.Format(
"workImage.altText = '{0}';", SelectedMediaContent.AltText));
sb.Append(
"getRadWindow().close(workImage);");
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ReturnImage", sb.ToString(), true); 

As I say, the system seems to be working as it places the created <img> tag in the editor window, but then focusing on the new img results in the error I pasted above.  Any suggestions on what I might need to disable to stop this error? I very much doubt I need it to do whatever it's trying to do when I focus on it!

Cheers,

Andrew
Rumen
Telerik team
 answered on 17 Aug 2009
3 answers
64 views
I'm trying to set up the Scheduler to use a custom skin. For now, I'm just copying the Office2007 skin into my project and trying to get it to look correct.

I've copied the Scheduler.Office2007.css file into my project directory and included it in my project. I also copied the 'Scheduler' folder with all the .gif and .png files and included it in my project.

I registered the skin in my .aspx file, like so:

<head runat="server">
    <title>My Calendar</title>
    <link href="Scheduler.Office2007.css" rel="stylesheet" type="text/css" />
</head> 

I set EnabledEmbeddedSkins to false, like so:

 <telerik:RadScheduler ID="RadScheduler1" runat="server" width="100%" Height = "600px"
         HoursPanelTimeFormat="htt" Skin="Office2007" StartInsertingInAdvancedForm="True"
            ValidationGroup="RadScheduler1"
            EnableEmbeddedBaseStylesheet="False" EnableEmbeddedSkins="false">
<Localization AdvancedAllDayEvent="All day"></Localization>
<AdvancedForm DateFormat="M/d/yyyy" TimeFormat="h:mm tt"></AdvancedForm>
        </telerik:RadScheduler>

When I run it, it's finding the images and doing something with the .css, but very ugly:

Screen Shot



Alex Gyoshev
Telerik team
 answered on 17 Aug 2009
2 answers
151 views

Hi,
I used RadGrid Export to Excel befor and it was working very good but this time I do not know why it dose not work, My Grid is a hierarchy model and both the parent and child grid DataSourse is binded with DataTable by code, and the format I used in exporting is "ExcelML". So is that the reason why it dose not work !!!
Please Help me and please as soon as possible.

Thanks
Ban
Ban
Top achievements
Rank 1
 answered on 17 Aug 2009
1 answer
502 views
Folks,

In my project I have 4 types of users. 1) HR Clerical 2) HR Manager 3) Regular User 4) Regular User Supervisor.

I am storing users type in a session variable (i.e. Session("UserType") ) after login page.

My intention is:

1) If Session("UserType")  = "HR Clerical"  then that user will have only access to Menu Item HR->HR Clerical Functons. 
2) If Session("UserType")  = "HR Manager"  then that user will have only access to Menu Item HR and all Child items under it
3) If Session("UserType")  = "Regular User"  then that user will have access to Menu Items Users->Regular Users Functions,  
Users->Reports,  
4) If Session("UserType")  = "Regular User Supervisorr"  then that user will have only access to Menu Item Users and all Child items under it

I am using RadControls for ASP.NET AJAX Q2 2009 NET35 with VS 2008 . Below is my Menu Declaration.  Any help will be appreciated. 
              
__________________________________________________

<

 

telerik:RadMenu runat="server" ID="RadMenu1" Style="float: none; left: 0px; height: 20px;"

 

 

 

OnItemClick="RadMenu1_ItemClick" Skin="Simple">

 

 

 

<Items>

 

 

 

    <telerik:RadMenuItem Text="HR">

 

 

 

        <Items>

 

 

 

            <telerik:RadMenuItem Text="HR Clerical Functons">

 

 

 

           </telerik:RadMenuItem>

 

 

 

           <telerik:RadMenuItem Text="HR Manager Functions">

 

 

 

           </telerik:RadMenuItem>

 

 

 

           <telerik:RadMenuItem Text="Reports">

 

 

 

           </telerik:RadMenuItem>

 

 

       </Items>
    </telerik:RadMenuItem>

   <
telerik:RadMenuItem Text="Users">

 

 

 

       <Items>

 

 

 

           <telerik:RadMenuItem Text="Regular Users Functions">

 

 

 

           </telerik:RadMenuItem>

 

 

 

           <telerik:RadMenuItem Text="Regular User Supervisor Functions">

 

 

 

           </telerik:RadMenuItem>

 

 

 

           <telerik:RadMenuItem Text="Reports">

 

 

 

             </telerik:RadMenuItem>

 

 

 

       </Items>

 

 

 

   </telerik:RadMenuItem>

</Items>

 

 

 

</telerik:RadMenu>

 

 

 

 

 

Paul
Telerik team
 answered on 17 Aug 2009
3 answers
121 views
I would like to put some summary items in the certain days of the Month View's  and I will put "More details..." as a LinkButton below the summary item in the same day.  When I click "More Details...", it should be able to switch to the "Day View"  with all detail items arranged in certain time period (for example: 10:00 pm to 2:30 pm) for the day I pick.

I found a similar demo at http://demos.telerik.com/aspnet-ajax/scheduler/examples/contextmenu/defaultcs.aspx, but I couldn't the code behind to show me how to implement this scenario.

Could some body tell me where I can find the code to implement similar stuff?

Thank you very much for any help in advance.
Peter
Telerik team
 answered on 17 Aug 2009
1 answer
161 views
So I have a RadScheduler binded to an SQLDataSource which is working correctly.  I then dropped in a RadToolTipManager which I want to onappointment click to show the tooltip.  This is working correctly.  It is showing me whatever is in the appointment boxes on the RadScheduler as well...  Here is my question...

How can I make the text within the tooltip custom?  I want to show a lot more detailed information of the appointment. 

You help is appreciated.


Alex Flores
Peter
Telerik team
 answered on 17 Aug 2009
3 answers
112 views
I like the way there is an arrow on the date and time fields in the standard insert and edit templates. How do I do this for if I am using an advanced tempalte. I can make the showpopuponfocus=true but I don't see how to put an arrow in the field.
Peter
Telerik team
 answered on 17 Aug 2009
1 answer
69 views
I use the old JavaScript method to confirm that a user really wants to leave my page.  Does Telerik provide any solution for this with more options?

Thanks!
Vlad
Telerik team
 answered on 17 Aug 2009
13 answers
307 views
Does the rad combobox offer support for multiple selections using check boxes? If so, is there a demo/example of this out there?

Thank You.
Chanan Zass
Top achievements
Rank 1
 answered on 17 Aug 2009
1 answer
155 views
Hi all,
I am having a radcombobox with some items at loading time , and  i need  to add another  new item into the combobox at the same time into the database also. Is there any additional property of radcombox to  achieve this?? If anyone knows please answer ..

thanks in advance
lekha
Princy
Top achievements
Rank 2
 answered on 17 Aug 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?