Add a possibility to set the auto-expand delay on drag-drop in RadTreeView.
Currently we do not support binding to the ToggleState.Indeterminate state automatically because it would require a change in the behavior of the Checked property. If you use the CheckedMember, the ToggleState.Indeterminate state is represent like ToggleState.On. Workaround: Subscribe to the NodeFormatting and NodeCheckedChanged events: void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e) { Child child = e.Node.DataBoundItem as Child; if (child != null) { e.Node.CheckState = child.Status; } } void radTreeView1_NodeCheckedChanged(object sender, Telerik.WinControls.UI.TreeNodeCheckedEventArgs e) { Child child = e.Node.DataBoundItem as Child; if (child != null) { child.Status = e.Node.CheckState; } }
Hi all,
RadTreeView is very nice control , For treeline we can give line style, color but we can't set line thickness,
I want to change thickness of Treeline can you guide me how to do it?
At the moment the filter predicate is called only for the root nodes. A possible workaround is to recursively apply the filter logic for the child nodes as well. Workaround: private void Button1_Click(object sender, EventArgs e) { this.radTreeView1.TreeViewElement.FilterPredicate = this.FilterNode; this.radTreeView1.Filter = "Custom"; } private bool FilterNode(RadTreeNode node) { Console.WriteLine(node.Text); if (node.Text.Contains("Child: 3")) { return true; } Stack<RadTreeNode> children = new Stack<RadTreeNode>(); if (node.Nodes.Count > 0) { children.Push(node); while (children.Count > 0) { RadTreeNode current = children.Pop(); foreach (RadTreeNode child in current.Nodes) { if (child.Text.Contains("Child: 3")) { return true; } children.Push(child); } } } return false; }
Workaround: private void radButton1_Click(object sender, EventArgs e) { var allNodes = radTreeView1.TreeViewElement.GetNodes().ToList(); int row = 0; Workbook workbook = new Workbook(); Worksheet newWorksheet = workbook.Worksheets.Add(); foreach (var item in allNodes) { CellSelection cell = newWorksheet.Cells[row, item.Level]; cell.SetValue(item.Text); cell = newWorksheet.Cells[row++, 2]; cell.SetValue(item.Checked); } var formatProvider = new XlsxFormatProvider(); var bytes = formatProvider.Export(workbook); File.WriteAllBytes(@"D:\Test.xlsx", bytes); }
Workaround: class CustomTreeView : RadTreeView { //Replace the default element with the custom one protected override RadTreeViewElement CreateTreeViewElement() { return new CustomTreeViewElement(); } //Enable theming for the control public override string ThemeClassName { get { return typeof(RadTreeView).FullName; } } } class CustomTreeViewElement : RadTreeViewElement { //Enable themeing for the element protected override Type ThemeEffectiveType { get { return typeof(RadTreeViewElement); } } protected override bool ProcessContextMenu(Point location) { RadTreeNode node = this.GetNodeAt(location); if (node == null) { RadContextMenu menu = new RadContextMenu(); RadMenuItem item = new RadMenuItem(); item.Text = "Add a root node"; menu.Items.Add(item); item.Click += item_Click; TreeViewContextMenuOpeningEventArgs args = new TreeViewContextMenuOpeningEventArgs(node, menu); OnContextMenuOpening(args); if (!args.Cancel) { menu.Show(this.ElementTree.Control, location); return true; } } return base.ProcessContextMenu(location); } private void item_Click(object sender, EventArgs e) { this.Nodes.Add(new RadTreeNode("New root")); } }
To reproduce: radTreeView1.Filter = "new"; var node = new RadTreeNode( "test" ); radTreeView1.Nodes.Add( node ); //here the node is not in the Nodes collection if ( radTreeView1.Nodes.Contains( node ) == false ) { radTreeView1.Nodes.Add( new RadTreeNode( "test" ) ); } Workaround: remove the filter, perform the desired check and restore the filter
Scenario: We have an object P which has two lists of child objects of types C1 and C2. If we create a list of P and we try to bind the tree to this list and display the two lists as child nodes, we will not succeed.
Private Sub LoadTvObjectInApp() Dim objectInApps As IQueryable(Of ObjectInApp) objectInApps = _context.ObjectInApps.Where(Function(c) (c.ApplicatieCode = "zis") AndAlso Not (c.GroepNaam = "hulp" AndAlso c.IsSysteemObject = True))
Sort the selected nodes according to their position in the tree
RadTreeView. Add node templates as ASP.NET AJAX - http://www.telerik.com/help/aspnet-ajax/treeview-templates-structure.html
I need to drop a simple plain text from a textbox into a Rad Treeview. I just read the forum, I'm mixing OLE Drag & Drop and RadTreeView Drag & Drop. The Events seems to be right and they seems to work fine. But I'm just having a problem with the Visual Indicators of the treeview: When I drag a regular node inside the treeview, I can see that visual indicators (the target node is highlighted, I can see a line of dots showing the direction above or below the target node, or the "forbidden" cursor, etc). And when I actually try to drag a simple text inside the treeview, I don't see any of those stuff. I need the same visual behavior when dropping a simple text. I need to see the indicators and I don't know how to activate them.
RadTreeView - export, print content possible supported file types: pdf, excel, html
drag select nodes. I.e - Left click and drag to highlight / select a bunch of nodes in a treeview. Ticket ID: 319445
Allow setting the AutoExpand time of node when drag operation is performing.
Improve the drag and drop indicators by giving more clean user friendly design and positioning.