Hello, I would like to add a node to the TreeView of the FileExplorer, and I was trying to do this in the Page_Load handler:
RadFileExplorer1.TreeView.Nodes.Add(new RadTreeNode("Recycle bin"));{
if (e.Item is GridGroupHeaderItem)
{
GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;
DataRowView groupDataRow = (DataRowView)e.Item.DataItem;
item.DataCell.Text =
"( " + groupDataRow["DC_Id"].ToString() + " ) " ;
}
}
Thanks in advance,
J
//creates a Node "Interventions"
RadTreeNode nodeInterventions = new RadTreeNode();
nodeInterventions.Text =
NodeConstants.InterventionNode;
//nodeInterventions.ContextMenuID = "MainContextMenu";
e.Node.Nodes.Add(nodeInterventions);
DataTable dtintervention=new DataTable();
dtintervention.Columns.Add(
"INTERVENTION");
dtintervention.Columns.Add(
"DISCIPLINE");
dtintervention.Columns.Add(
"FREQUENCY");
dtintervention.Columns.Add(
"DURATION_IN_WEEK");
 
foreach (DataRow row in data.Rows)
{
dtintervention.Rows.Add(row[
"INTERVENTION"].ToString(), row["DISCIPLINE"].ToString(), row["FREQUENCY"].ToString(), row["DURATION_IN_WEEK"].ToString());
}
//adding a dynamic grid to treeview
RadGrid rgrv_Interventions = new RadGrid();
rgrv_Interventions.DataSource = dtintervention;
rgrv_Interventions.DataBind();
//addign the control to the treenode
RadTreeNode nodeint = new RadTreeNode();
nodeint.Controls.Add(rgrv_Interventions);
nodeInterventions.Nodes.Add(nodeint);
}
Hi...
I am able to place a normal grid view..but why not a radgrid..
regards
Delia Joe
<appointmentcontextmenus> <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu"> <Items> <telerik:RadMenuItem Text="Edit" Value="CommandEdit" /> <telerik:RadMenuItem IsSeparator="True" /> <telerik:RadMenuItem Text="Export" Value="Export" /> </Items> </telerik:RadSchedulerContextMenu></appointmentcontextmenus>AppointmentContextMenuItemClicking" event is not working as required. In debugging mode it never comes to this event. incase of "CommandEdit" it automatically opens the Edit form (i.e. Advanced Edit template).protected void RadScheduler1_AppointmentContextMenuItemClicking(object sender, AppointmentContextMenuItemClickingEventArgs e) { if (e.MenuItem.Text.Contains("Export")) { WriteCalendar(RadScheduler.ExportToICalendar(e.Appointment)); e.Cancel = true; } }Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'set root path to browse on remote system Dim RootPath As String = "/dcinvol2/jobs" 'create root node for treeview Dim RootNode As New TreeNode(RootPath) 'instantiate new XML RPC class Dim XmlRpc As New Magic.XML_RPC If XmlRpc.IsRunning Then 'return all files and folders Dim FilesAndFolders As New ArrayList() FilesAndFolders.AddRange(XmlRpc.GetFolders(RootPath, False, True, 1)) If FilesAndFolders.Count > 0 Then 'add each file or folder to rootnode For Each FileOrFolder As String In FilesAndFolders Dim ChildNode As New TreeNode(FileOrFolder) RootNode.ChildNodes.Add(ChildNode) Next 'add rootnode to treeview TreeView1.Nodes.Add(RootNode) End If End If End SubImports CookComputing.XmlRpcNamespace Magic Public Class XML_RPC Private _iproxy As XmlRpcInt Public Sub New() _iproxy = CType(XmlRpcProxyGen.Create(GetType(XmlRpcInt)), XmlRpcInt) End Sub ''' <summary> ''' Check if service is running. ''' </summary> ''' <returns>True if service is running, otherwise False.</returns> Public Function IsRunning() As Boolean Dim strRet As String Try strRet = _iproxy.IsServerRunning() Catch ex As Exception Return False End Try If strRet.Length > 0 And strRet <> Nothing Then Return True Return False End Function ''' <summary> ''' Gets all sub folders under the path specified. ''' <param name="path">Path to query.</param> ''' <param name="fullPath">Optional - return the full path</param> ''' <param name="returnFiles">Optional - return the files in a dir</param> ''' <param name="drill_to_level_x">Optional - return a depth of dirs</param> ''' </summary> ''' <returns>Array of paths.</returns> Function GetFolders(ByVal path As String, Optional ByVal fullPath As Boolean = True, Optional ByVal returnFiles As Boolean = False, Optional ByVal drill_to_level_x As Integer = 0) As Array Dim al As New ArrayList Try Dim a As Array = Nothing a = _iproxy.GetFolders(path, fullPath, returnFiles, drill_to_level_x) For Each s As String In a 'Perform clean up If s = "." Then Continue For If s.StartsWith(".") Then s = s.TrimStart(".") If s.StartsWith("/") Then s = s.TrimStart("/") al.Add(s) Next Catch ex As Exception Return al.ToArray End Try Return al.ToArray End Function ''' <summary> ''' Looks for file specified and returns file in binary format. ''' </summary> ''' <param name="filename">The full path to file, including filename.</param> ''' <returns>Array in bytecode format.</returns> Function GetBinaryFile(ByVal filename As String) As Array Dim a As Array = Nothing Try a = _iproxy.GetBinaryFile(filename) Catch ex As Exception Return a End Try Return a End Function ''' <summary> ''' Checks if given path exists. ''' </summary> ''' <param name="path">The full path to folder/file.</param> ''' <param name="folder">Check folder or file exists.</param> ''' <returns>True if path exists, False otherwise.</returns> Function PathExists(ByVal path As String, Optional ByVal folder As Boolean = True) As Boolean Try Return _iproxy.PathExists(path, folder) Catch ex As Exception Return False End Try End Function ''' <summary> ''' Returns number of files in given path, currently this descends into sub folders. ''' </summary> ''' <param name="path">The full path to folder.</param> ''' <returns>Number of files in the path.</returns> Function GetNumberOfFiles(ByVal path As String) As Integer Dim i As Integer = 0 Try i = CInt(_iproxy.GetNumberOfFiles(path)) Catch ex As Exception Return i End Try Return i End Function ''' <summary> ''' Returns number of kilobytes in given path. ''' </summary> ''' <param name="path">The full path to folder.</param> ''' <returns>Number of kilobytes in the path.</returns> Function GetByteSize(ByVal path As String) As Integer Dim i As String = 0 Try i = CInt(_iproxy.GetByteSize(path)) Catch ex As Exception Return i End Try Return i End Function End ClassEnd Namespace