or
<script type="text/javascript"> var doPostback = true; function pageLoad() { doPostback = false; $find("<%= RadComboBox1.ClientID %>").findItemByValue("YourItemHere").select(); doPostback = true; } function OnClientSelectedIndexChanged(sender, eventArgs) { if (doPostback) { __doPostBack('RadComboBox1', ''); } } </script><telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server"><AjaxSettings> <telerik:AjaxSetting AjaxControlID="grdOne" > <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="txtOne" LoadingPanelID="RadAjaxLoadingPanel3" /> <telerik:AjaxUpdatedControl ControlID="pnlOne" LoadingPanelID="RadAjaxLoadingPanel3" /> </UpdatedControls> </telerik:AjaxSetting>
Partial Public Class Plans Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Master.pgmCurrentMenu = "Plans" Master.InitBanner() End Sub Private Sub RadFileExplorer1_ExplorerPopulated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadFileExplorerPopulatedEventArgs) Handles RadFileExplorer1.ExplorerPopulated Dim result As List(Of FileBrowserItem) = New List(Of FileBrowserItem) For Each item In e.List If item.Name.ToUpper.Contains(TextBox1.Text.ToUpper) Then result.Add(item) End If Next e.List = result End Sub Private Sub RadFileExplorer1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadFileExplorerEventArgs) Handles RadFileExplorer1.ItemCommand Dim Utilisateur As String Dim Fichier As New Gestion_FichierUpload Utilisateur = Master.pgmInfoUser.Login Master.pgmCurrentMenu = "BEPLAN" Master.InitBanner() 'MsgBox(e.Command.ToString) 'MsgBox(e.NewPath.ToString) 'MsgBox(e.Path.ToString) Select Case e.Command Case "UploadFile" If (e.Path = e.NewPath) Then Fichier.Add_Fichier_Sql(e.Path.ToString, Utilisateur, "Ecraser") Else Fichier.Add_Fichier_Sql(e.Path.ToString, Utilisateur, "Telecharger") End If Case "MoveDirectory" Fichier.Renommer_Dossier(e.Path, e.NewPath, Utilisateur) Case "CreateDirectory" Fichier.Add_Repertoire_Sql(e.Path.ToString & e.NewPath.ToString, Utilisateur) Case "DeleteFile" Fichier.Copie_Corbeille(e.Path, e.NewPath) Fichier.Supp_Fichier_Sql(e.Path, Utilisateur) Case "MoveFile" Fichier.Renommer_Fichier(e.Path, e.NewPath, Utilisateur) Case "DeleteDirectory" Fichier.Supp_Repertoire_Sql(e.Path.ToString, Utilisateur) Case Else End Select Dim viewPaths As String() = New String() {""} Dim test As New Gestion_FichierUpload If RadFileExplorer1.CurrentFolder <> "Donnees BE/" & RadComboBox1.SelectedValue.ToString And RadFileExplorer1.CurrentFolder IsNot Nothing Then Dim s1 As String = "" s1 = RadFileExplorer1.CurrentFolder viewPaths = New String() {RadFileExplorer1.CurrentFolder} RadFileExplorer1.Visible = True RadFileExplorer1.TreeView.Nodes.Clear() RadFileExplorer1.Configuration.ViewPaths = viewPaths RadFileExplorer1.Configuration.UploadPaths = viewPaths RadFileExplorer1.Configuration.DeletePaths = viewPaths RadFileExplorer1.TreeView.MaxDataBindDepth = 30 RadFileExplorer1.DisplayUpFolderItem = True RadFileExplorer1.EnableCopy = True RadFileExplorer1.EnableCreateNewFolder = True RadFileExplorer1.Language = "fr-FR" RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000 RadFileExplorer1.AllowPaging = True RadFileExplorer1.Visible = True RadFileExplorer1.InitialPath = s1 RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName End If If RadComboBox1.SelectedValue <> Session.Item("ComboValue") Then Dim s1 As String = "" s1 = RadFileExplorer1.CurrentFolder Session.Clear() Session.Add("ComboValue", RadComboBox1.SelectedValue) viewPaths = New String() {test.Get_Repertoire(RadComboBox1.SelectedValue.ToString)} RadFileExplorer1.Visible = True RadFileExplorer1.TreeView.Nodes.Clear() RadFileExplorer1.Configuration.ViewPaths = viewPaths RadFileExplorer1.Configuration.UploadPaths = viewPaths RadFileExplorer1.Configuration.DeletePaths = viewPaths RadFileExplorer1.TreeView.MaxDataBindDepth = 30 RadFileExplorer1.DisplayUpFolderItem = True RadFileExplorer1.EnableCopy = True RadFileExplorer1.Language = "fr-FR" RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000 RadFileExplorer1.AllowPaging = True RadFileExplorer1.EnableCreateNewFolder = True RadFileExplorer1.InitialPath = s1 RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName End If End Sub Private Sub RadFileExplorer1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadFileExplorer1.Load Dim viewPaths As String() = New String() {""} Dim test As New Gestion_FichierUpload Dim Utilisateur As String = Master.pgmInfoUser.Autorisation If IsPostBack Then If RadFileExplorer1.CurrentFolder <> "Donnees BE/" & RadComboBox1.SelectedValue.ToString And RadFileExplorer1.CurrentFolder IsNot Nothing Then Dim s1 As String = "" s1 = RadFileExplorer1.CurrentFolder viewPaths = New String() {RadFileExplorer1.CurrentFolder} RadFileExplorer1.Visible = True RadFileExplorer1.TreeView.Nodes.Clear() RadFileExplorer1.Configuration.ViewPaths = viewPaths RadFileExplorer1.Configuration.UploadPaths = viewPaths RadFileExplorer1.Configuration.DeletePaths = viewPaths RadFileExplorer1.TreeView.MaxDataBindDepth = 30 RadFileExplorer1.DisplayUpFolderItem = True RadFileExplorer1.EnableCopy = True RadFileExplorer1.EnableCreateNewFolder = True RadFileExplorer1.Language = "fr-FR" RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000 RadFileExplorer1.AllowPaging = True RadFileExplorer1.Visible = True RadFileExplorer1.InitialPath = s1 RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName End If If RadComboBox1.SelectedValue <> Session.Item("ComboValue") Then Dim s1 As String = "" s1 = RadFileExplorer1.CurrentFolder Session.Clear() Session.Add("ComboValue", RadComboBox1.SelectedValue) viewPaths = New String() {test.Get_Repertoire(RadComboBox1.SelectedValue.ToString)} RadFileExplorer1.Visible = True RadFileExplorer1.TreeView.Nodes.Clear() RadFileExplorer1.Configuration.ViewPaths = viewPaths RadFileExplorer1.Configuration.UploadPaths = viewPaths RadFileExplorer1.Configuration.DeletePaths = viewPaths RadFileExplorer1.TreeView.MaxDataBindDepth = 30 RadFileExplorer1.DisplayUpFolderItem = True RadFileExplorer1.EnableCopy = True RadFileExplorer1.Language = "fr-FR" RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000 RadFileExplorer1.AllowPaging = True RadFileExplorer1.EnableCreateNewFolder = True RadFileExplorer1.InitialPath = s1 RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName End If Else viewPaths = New String() {"Donnees BE/140"} RadFileExplorer1.TreeView.Nodes.Clear() RadFileExplorer1.Configuration.ViewPaths = viewPaths RadFileExplorer1.Configuration.UploadPaths = viewPaths RadFileExplorer1.Configuration.DeletePaths = viewPaths RadFileExplorer1.TreeView.MaxDataBindDepth = 30 RadFileExplorer1.DisplayUpFolderItem = True RadFileExplorer1.EnableCopy = True RadFileExplorer1.EnableCreateNewFolder = True RadFileExplorer1.Language = "fr-FR" RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000 RadFileExplorer1.AllowPaging = True RadFileExplorer1.Visible = False RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName End If End Sub Private Sub TextBox1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Load TextBox1.AutoPostBack = True End Sub Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged TextBox1.AutoPostBack = True End Sub Private Sub RadComboBox1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadComboBox1.Load RecursiveSearch2("\\vm-cham-files2\Share$\Plans\PLANS BE\", RadComboBox1) End Sub Private Function RecursiveSearch2(ByVal path As String, ByVal Radcombobox As RadComboBox) As List(Of String) Dim repertoires As New List(Of String) Dim dirInfo As New IO.DirectoryInfo(path) Dim fileObject As FileSystemInfo Dim compteur As Integer = 0 compteur = dirInfo.GetFileSystemInfos().Length For Each fileObject In dirInfo.GetFileSystemInfos() Dim rdcbbox As New RadComboBoxItem rdcbbox.Value = fileObject.Name rdcbbox.Text = fileObject.Name Radcombobox.Items.Add(rdcbbox) Next Return repertoires End FunctionEnd Class
My main problem occurs when I try to upload or create new folder on nodes deeper than 2
Example:
Folder1 Buttons (Upload and CreateNewFolder) enabled
-Folder2 Buttons (Upload and CreateNewFolder) enabled
-Folder3 Buttons (Upload and CreateNewFolder) enabled
-Folder4 Buttons (Upload and CreateNewFolder) disabled
-Folder5 Buttons (Upload and CreateNewFolder) disabled
Thanx for your help
<telerik:RadComboBox ID="RadComboBoxSymbols" runat="server" AutoPostBack="true" OnClientSelectedIndexChanged="OnSymbolChange" OnSelectedIndexChanged="RadComboBoxSymbols_SelectedIndexChanged" Width="100"> </telerik:RadComboBox>private void BindToSymbolsList(Values.pointReg.PointRegistration pointRegistration) { RadComboBoxSymbols.Items.Clear(); foreach (Symbol symbol in pointRegistration.Getallsymbols()) { RadComboBoxItem item = new RadComboBoxItem(symbol.Name,symbol.Id); item.ImageUrl = symbol.Path; RadComboBoxSymbols.Items.Add(item); } RadComboBoxSymbols.SelectedIndex = 0; }Private Sub RadGrid_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid.PreRender For Each column As GridColumn In RadGrid.MasterTableView.Columns If column.UniqueName = "ID" Then column.Visible = False 'Not column.Visible End If Next For Each column2 As GridColumn In RadGrid.Columns If column2.UniqueName = "ID" Then column2.Visible = False 'Not column.Visible End If Next 'Dim column3 As GridColumn = RadGrid.MasterTableView.GetColumnSafe("ID") 'If column3 IsNot Nothing Then ' column3.Visible = False 'Not column.Visible 'End If RadGrid.MasterTableView.Rebind() End SubProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack() Then Dim bp As BasePage bp = CType(Parent.Page, BasePage) RadGrid.DataSource = bp.mDs bp.ExecuteQuery(" WHERE 1 = 0 ") End IfEnd Sub