This is a migrated thread and some comments may be shown as answers.

Problem receiving the SelectedGridItem from the FileExplorer

2 Answers 59 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Suneco
Top achievements
Rank 2
Suneco asked on 27 May 2009, 03:12 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Fiko
Telerik team
answered on 29 May 2009, 01:58 PM
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.
0
Suneco
Top achievements
Rank 2
answered on 02 Jun 2009, 07:23 AM
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
Tags
FileExplorer
Asked by
Suneco
Top achievements
Rank 2
Answers by
Fiko
Telerik team
Suneco
Top achievements
Rank 2
Share this question
or