Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
176 views
I'm trying to use a RadGrid inside a modal popup created with the AJAX Control Toolkit's ModalPopupExtender control.  However, when I click on the column filter menu provided by the RadGrid, the context menu shows up behind the modal popup.  I've tried adjusting the z-order style of the both the menu and the popup by using CSS classes, but both seem to use inline styles to set their z-indexes.  The popup uses a value of 10000, while the RadGrid filter menu uses a value of 7000.  Is there any way I can set the z-index value the menu uses, so that it shows up above the popup?
brian sullivan
Top achievements
Rank 1
 answered on 07 Oct 2009
6 answers
156 views
Hi All,
I am currently integrating the RadEditor Prometheus into my app and I have run into one problem, in IE the text that reads  the font size or font name (and all the text on all other dropdowns) is too small. A CSS check has it coming up as 1px, but when I hover over it it switches to 11px. It appears the non-hover text is using a wrapper CSS class, despite the fact that the non-hover version of the class is defined just fine in the CSS file. In Firefox the text size is fine at 11px, with or without hover.

Has anyone else encountered this or know of a workaround?

Thanks,
Chris
Gregory Butt
Top achievements
Rank 1
 answered on 06 Oct 2009
8 answers
271 views
Does a document exist on converting from Ajax toolkit tabs to RadTabStrip?
Phil
Phil
Top achievements
Rank 2
 answered on 06 Oct 2009
2 answers
245 views
I've been doing some research lately to try and find out what the exact advantages of Telerik are over using the standard controls provided by the .NET framework, particularly the radgrid vs gridview.  I am presenting to a group of co workers on this topic and I have found a lot of information but I wanted to know if Telerik has any of this information readily available?  Thanks.
eric
Top achievements
Rank 1
 answered on 06 Oct 2009
1 answer
117 views
When I add a decorator to my page the styling applied is transparent.  I am using the Office2007 skin which is set globally in the Web.config.

I add the following to a page:

<

 

telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" />

 


instead of the decorated radio buttons they appear for a second and then seem to disappear.  The standard asp buttons appear to have a background color the same as the form. This also happens on a radconfirm but the title bar is also completely transparent.

Any idea of what might be going on here?
Robert
Top achievements
Rank 1
 answered on 06 Oct 2009
1 answer
325 views
Hi,
I am trying to enable//disable RadNumericextBox using javascript.
I am using the following as I saw in the documentation but i get the error: ntbRetention.enable is not a function

function UseBackupChanged(useBackup,ntbRetentionId) { 
 
 
    var ntbRetention = document.getElementById(ntbRetentionId);    
        
    if (useBackup == true) {       
        ntbRetention.enable(); 
    } 
    else { 
        ntbRetention.disable(); 
    } 

Can anyone please help what am I doing wrong??

Thanks!
Ruth
Pavlina
Telerik team
 answered on 06 Oct 2009
3 answers
107 views
I have a popup edit form and in my template I have a table with a width of 100% but when I run my project and open the edit form it's not 100%.  The behavior makes me think the white space tot he right is where a scrollbar would be. But there is no scrollbar.

How can I get rid of this extra white space within my template. In the designer it shows the table as 100% of the template. 
Pavlina
Telerik team
 answered on 06 Oct 2009
1 answer
759 views
Hi Telerik !

Iam using the RAD FILE EXPLROER in one of my project. I have uploade the files with the following extensions :-

.docx,
.doc, .xslx
.pdf & many images file such as .jpeg,.jpg,.gif,.bmp.

I have implemented the following javascript function in order to open the file in the context menu:-

 function OnClientFileOpen(oExplorer, args) {  
            debugger;  
            var item = args.get_item();  
            var fileExtension = item.get_extension();  
 
            //var fileDownloadMode = document.getElementById("chkbxDownoaldFile").checked;  
            if ((fileExtension == "jpg" || fileExtension == "gif") && fileExtension == "xlsx" || fileExtension == "docx") {// Download the file   
                // File is a image document, do not open a new window  
                args.set_cancel(true);  
 
                // Tell browser to open file directly  
                var requestImage = "FileSystemHandler.ashx?path=" + item.get_url();  
                document.location = requestImage;  
            //}  
        }  
 
 
 
 I have the following code implemented on to my FileSystemHandler.ashx file :-
<%@ WebHandler Language="C#" Class="Handler" %> 
using System;  
using System.Data;  
using System.Configuration;  
using System.Web;  
using System.IO;  
using System.Collections.Generic;  
using System.Xml;  
 
public class Handler : IHttpHandler  
{  
    #region IHttpHandler Members  
 
    string pathToConfigFile = "~/App_Data/MappingFile.mapping";  
    private HttpContext _context;  
    private HttpContext Context  
    {  
        get  
        {  
            return _context;  
        }  
        set  
        {  
            _context = value;  
        }  
    }  
 
 
    public void ProcessRequest(HttpContext context)  
    {  
        Context = context;  
 
        if (context.Request.QueryString["path"] == null)  
        {  
            return;  
        }  
 
        string virtualPathToFile = Context.Server.HtmlDecode(context.Request.QueryString["path"]);  
        string physicalPathToFile = "";  
        Dictionary<string, string> mappedPathsInConfigFile = this.GetMappingsFromConfigFile();  
        foreach (KeyValuePair<string, string> mappedPath in mappedPathsInConfigFile)  
        {  
            if (virtualPathToFile.ToLower().StartsWith(mappedPath.Key.ToLower()))  
            {  
                // Build the physical path to the file ;  
                physicalPathToFile = virtualPathToFile.Replace(mappedPath.Key, mappedPath.Value).Replace("/", "\\");  
 
                break;// Brak the foreach loop ;  
            }  
        }  
 
        if (physicalPathToFile == null)  
        {  
            return;  
        }  
 
        System.IO.StreamReader streamReader = new System.IO.StreamReader(physicalPathToFile);  
        System.IO.BinaryReader br = new System.IO.BinaryReader(streamReader.BaseStream);  
 
        byte[] bytes = new byte[streamReader.BaseStream.Length];  
 
        br.Read(bytes, 0, (int)streamReader.BaseStream.Length);  
 
        if (bytes == null)  
        {  
            return;  
        }  
 
        streamReader.Close();  
        br.Close();  
        string extension = System.IO.Path.GetExtension(physicalPathToFile);  
        string fileName = System.IO.Path.GetFileName(physicalPathToFile);  
 
        if (extension == ".jpg")  
        { // Handle *.jpg and  
            WriteFile(bytes, fileName, "image/jpeg jpeg jpg jpe", context.Response);  
        }  
        else if (extension == ".gif")  
        {// Handle *.gif  
            WriteFile(bytes, fileName, "image/gif gif", context.Response);  
        }  
    }  
    private void WriteFile(byte[] content, string fileName, string contentType, HttpResponse response)  
    {  
        response.Buffer = true;  
        response.Clear();  
        response.ContentType = contentType;  
 
        response.AddHeader("content-disposition", "attachment; filename=" + fileName);  
 
        response.BinaryWrite(content);  
        response.Flush();  
        response.End();  
    }  
      
      
    public bool IsReusable  
    {  
        get  
        {  
            return false;  
        }  
    }  
 
 
    /// <summary> 
    /// Retrieves the mapping for view paths ;  
    /// </summary> 
    /// <param name="virtualPathToConfigFile">The fvirtual path to the config file </param> 
    /// <returns>The mappings </returns> 
    private Dictionary<string, string> GetMappingsFromConfigFile()  
    {  
        XmlDocument configFile = new XmlDocument();  
        string physicalPathToConfigFile = Context.Server.MapPath(this.pathToConfigFile);  
        configFile.Load(physicalPathToConfigFile);// Load the configuration file ;  
 
        XmlElement rootElement = configFile.DocumentElement;  
        XmlNode mappingsSection = rootElement.GetElementsByTagName("Mappings")[0]; // get all mappings ;  
 
        Dictionary<string, string> mappingsFromConfigFile = new Dictionary<string, string>();  
        foreach (XmlNode mapping in mappingsSection.ChildNodes)  
        {  
            XmlNode virtualPathAsNode = mapping.SelectSingleNode("child::VirtualPath");  
            XmlNode physicalPathAsNode = mapping.SelectSingleNode("child::PhysicalPath");  
            mappingsFromConfigFile.Add(this.AddSlashAtEndOfVirtualPath(virtualPathAsNode.InnerText), this.AddSlashAtEndOfPhysicalPath(physicalPathAsNode.InnerText));  
        }  
 
        return mappingsFromConfigFile;  
    }  
 
    /// <summary> 
    /// Gets the path to the generic handler. It should be a virtual path  
    /// </summary> 
    /// <returns>Path to the generic handler</returns> 
    private string GetPathTogenericHandler()  
    {  
        XmlDocument configFile = new XmlDocument();  
        string physicalPathToConfigFile = Context.Server.MapPath(this.pathToConfigFile);  
        configFile.Load(physicalPathToConfigFile);// Load the configuration file ;  
 
        XmlElement rootElement = configFile.DocumentElement;  
        XmlNode handlerPathSection = rootElement.GetElementsByTagName("genericHandlerPath")[0]; // get all mappings ;  
 
        return handlerPathSection.InnerText;  
    }  
 
    //////////////////////////////////////////////////////////////////////////////////////////////////////////  
    //  The custom methods   
    //////////////////////////////////////////////////////////////////////////////////////////////////////////  
    /// <summary> 
    /// Adds a backslash at the end of a physical path if the slash does not exists ;  
    /// </summary> 
    /// <param name="physicalPath">Physical path</param> 
    /// <returns></returns>  
    private string AddSlashAtEndOfPhysicalPath(string physicalPath)  
    {  
 
        if (!physicalPath.EndsWith("\\"))  
        {  
            return physicalPath + "\\";  
        }  
        else  
        {  
            return physicalPath;  
        }  
    }  
 
    /// <summary> 
    /// Adds a backslash at the end of a virtual path if the slash does not exists ;  
    /// </summary> 
    /// <param name="virtualPath">Virtual path</param> 
    /// <returns></returns>  
    private string AddSlashAtEndOfVirtualPath(string virtualPath)  
    {  
 
        if (!virtualPath.EndsWith("/"))  
        {  
            return virtualPath + "/";  
        }  
        else  
        {  
            return virtualPath;  
        }  
    }  
    #endregion  
    } 
Also, I have used the following in the ASPX Page :-

<telerik:RadFileExplorer runat="server" ID="DocumentsRadFileExplorer" Width="734px" 
                    Height="400px" VisibleControls="All" EnableCreateNewFolder="true" EnableCopy="true" EnableOpenFile="true" 
                    OnClientMove="OnClientMove" OnClientFileOpen="OnClientFileOpen" OnClientDelete="OnClientDelete" OnClientLoad="attachHandlers" > 
             <Configuration SearchPatterns="*.*"></Configuration> 
                </telerik:RadFileExplorer> 
Now whenever I try to open the file with .doc or .docx or .pdf extension file does not get open in MS word format. PDF file opens ups but with its name changed as FileHandler.pdf.

Apart form that, I have used all the sample that has been sent by all your member earlier but all in vain.

Below is the list of javascript function that I have used so far :-
       function OnClientFileOpen(sender, args)      
{  
   var item = args.get_item();  
   if (item && !item.isDirectory() && (item.get_extension() == "docx") && (item.get_extension() == "doc"))  
   {  
       //file is a MS Office document, do not open a new window.    
       args.set_cancel(true);  
         
       //tell browser to open file directly  
       //window.location.href = item.get_url();  
       var requestImage = "Handler.ashx?path=" + item.get_url();  
       window.location.href = requestImage;  
         
   }  
}   
      
        function OnExplorerFileOpen(oExplorer, args) {  
            var item = args.get_item();  
            var fileExt = item.get_extension();  
            if (fileExt == "jpg") {  
                var oWindowManager = oExplorer.get_windowManager();  
                args.set_cancel(true);  
                var newURL = "Popup.aspx?path=" + item.get_path();  
                var oWindow = oWindowManager.open(newURL, "RadWindow1");  
                oWindow.setSize(500, 500);  
            }  
            else if (fileExt == "pdf") {  
                setTimeout(  
                        function() {  
                            var oWindow = oExplorer.get_windowManager().getActiveWindow();  
                            oWindow.setSize(500, 600);  
                        }, 500);  
            }  
        }  
 
 
        function OnClientFileOpen(sender, args) {  
            LogEvent("Item open: " + args.get_item().get_name());  
        }  
 
        function LogEvent(text) {  
            var d = new Date();  
            var ddateStr = d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds();  
            var eventConsole = $get("eventConsole");  
            eventConsole.innerHTML += "[" + dateStr + "] " + text + "<br/>";  
        }  
 
        function OnClientFileOpen(oExplorer, args) {  
            debugger;  
            var item = args.get_item();  
            var fileExtension = item.get_extension();  
 
            //var fileDownloadMode = document.getElementById("chkbxDownoaldFile").checked;  
            if ((fileExtension == "jpg" || fileExtension == "gif") && fileExtension == "xlsx" || fileExtension == "docx") {// Download the file   
                // File is a image document, do not open a new window  
                args.set_cancel(true);  
 
                // Tell browser to open file directly  
                var requestImage = "FileSystemHandler.ashx?path=" + item.get_url();  
                document.location = requestImage;  
            //}  
        }  
 


Please help me to solve my problem .

Thanks & Regards

Ajay Jamwal 
Fiko
Telerik team
 answered on 06 Oct 2009
1 answer
140 views

I add a RadRotator to my page control collection dynamically. I create a new itemTemplate and assign a datasource.


DataTable
dataTable = GetDataSetFromXml().Tables[0];

 

RadRotator1.ItemTemplate = new RotatorItemTemplate();

RadRotator1.DataSource = dataTable;

RadRotator1.DataBind();

RadRotator1.ScrollDirection = RotatorScrollDirection.Up.  

....

private class RotatorItemTemplate : ITemplate

 

{

Label literal;

public void InstantiateIn(Control container)

{

literal = new Label();

literal.DataBinding += literal_DataBinding;

container.Controls.Add(literal);

}

static void literal_DataBinding(object sender, EventArgs e)

{

Label labelControl = (Label)sender;

RadRotatorItem rotatorItem = (RadRotatorItem)labelControl.NamingContainer;

string html = (string)((DataRowView)rotatorItem.DataItem)["Html"];

labelControl.Text = "<table cellpadding=\"0\" cellspacing=\"1\"><tr><td>" + html + "</td></tr></table>";

}

}

When i run my project the rotator shows all the rotatoritems side by side; the rotator doen't scroll.
The RadScriptManagers is included in the page.

Can anyone help me solve this problem?

Fiko
Telerik team
 answered on 06 Oct 2009
1 answer
104 views
Is it possible to disable automatic expanding of a tree node?

When I select a folder that has children, the explorer automatically opens that tree. I don't want that to happen. I only want the tree to expand if the user explicitly clicks the "+" plus button.

Greg
Fiko
Telerik team
 answered on 06 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?