Problem receiving the SelectedGridItem from the FileExplorer

3 posts, 1 answers
  1. Suneco
    Suneco avatar
    30 posts
    Member since:
    Mar 2005

    Posted 27 May 2009 Link to this post

    Hi,

    I have got a problem receiving the selected GridItem out of the GridView "Telerik.Web.UI.RadFileExplorer.Grid". When i request "Grid.SelectedValue" it's sends back an object. I tried to convert it to all kinds of formats but could not discover the good format. I am curious about which format it returns.

    But if i try to request "Telerik.Web.UI.RadFileExplorer.Grid.Items" it returns 0 items, dont know why couse in my browser there are realy 3 directory's in the explorer.

    public class FileExplorer : Telerik.Web.UI.RadFileExplorer  
        {  
            /// <summary>  
            /// Raises the <see cref="E:Init"/> event.  
            /// </summary>  
            /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>  
            protected override void OnInit(EventArgs e)  
            {  
                InitializeControls();  
     
                this.GridContextMenu.ItemClick += new RadMenuEventHandler(GridContextMenu_ItemClick);  
     
                base.OnInit(e);  
            }  
     
            /// <summary>  
            /// Initializes the controls.  
            /// </summary>  
            private void InitializeControls()  
            {  
                this.Configuration.ContentProviderTypeName = typeof(Sunnova.Web.UI.Controls.SunnovaFileStreamContentProvider).AssemblyQualifiedName;  
                this.Configuration.ViewPaths = new string[] { "/app_files" };  
                this.Configuration.UploadPaths = new string[] { "/app_files" };  
     
                this.Configuration.MaxUploadFileSize = 2000000;  
     
                RadMenuItem rmi = new RadMenuItem("Unzip");  
                this.GridContextMenu.Items.Add(rmi);  
     
                foreach (RadMenuItem item in this.GridContextMenu.Items)  
                    if (item.ID != rmi.ID)  
                        item.PostBack = false;  
            }  
     
            void GridContextMenu_ItemClick(object sender, RadMenuEventArgs e)  
            {  
                "Here must the item be requested." 
            }  
        } 

    I need to receive the file path of the selected file. Am i in the right direction or all wrong ?

    I'll think you guys can help me out right ? 

    Thank you in advance,
  2. Answer
    Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 29 May 2009 Link to this post

    Hello Jeroen,

    In your case you need to use some client-side script in order to get the value of the currently selected item. For your convenience I have attached a runnable demo that shows the steps you need to implement in order to achieve the desired result. Could you please check it and let me know whether it fits your requirements?

    Best wishes,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Suneco
    Suneco avatar
    30 posts
    Member since:
    Mar 2005

    Posted 02 Jun 2009 Link to this post

    Hello Fiko,

    I just looked at your  project file and it fits my problem perfectly, this is the awnser on my problem.

    Thanks,
    Jeroen Speldekamp
Back to Top