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

Node Appearance

8 Answers 175 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 01 May 2013, 11:40 PM
I'm copying again.  I think this is a TreeView.  The attached image has my questions.

8 Answers, 1 is accepted

Sort by
0
Doug
Top achievements
Rank 1
answered on 01 May 2013, 11:46 PM
And another detail I just noticed is that I don't want the standard highlight to happen when I click any node.  I just want the visual appearance to remain unchanged from when you first load the form and just look at the treeview.
0
Peter
Telerik team
answered on 06 May 2013, 11:54 AM
Hi Gary,

Thank you for writing.

I am not sure that you can achieve the exact same look with our controls but you can try to customize RadListView when grouped and use the VisualItemFormatting event in order to format the items.

As to your questions:
1) You can set AllowDragDropDrop property to false.
2) By default the list items are stretched to fill the available space. I set the position offset to 20 in order to achieve the left offset of the items.
3) You should set the DrawBorder property to true and the BorderColor of the ListViewElement's. Please, note that I have also set the BorderDashStyle to Dot.
4) You can get the background color and set it to the particular element as follows:
if (e.VisualItem is SimpleListViewGroupVisualItem)
{
              e.VisualItem.DrawFill = true;
              e.VisualItem.BackColor = this.radListView1.BackColor;
5) This color cannot be set and I not able to provide a workaround for this.

Please, refer to the attached sample project. Also, I would like to recommend to read this help article - Customizing existing items.

I hope this helps.

Greetings,
Peter
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Doug
Top achievements
Rank 1
answered on 06 May 2013, 02:57 PM
Hello Peter,

Thank you for that information.  I'm looking at the documentation for ListView.  I noticed this graphic on the getting started page (http://www.telerik.com/help/winforms/listview-getting-started.html) and I wonder if this image is a Telerik control.  If so, which one?

Thank you,
Gary
0
Peter
Telerik team
answered on 07 May 2013, 12:41 PM
Hi Gary,

Thank you for writing back.

This is a Visual Studio Control that represents the table from database. We do not have such control and I cannot provide a way to customize the color in the left side in our RadListView

Thank you for the understanding.

Kind regards,
Peter
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Doug
Top achievements
Rank 1
answered on 14 May 2013, 11:16 PM
I'm back from considering how to implement the ListView the way I would like.  That won't work.  So what I want to do with the TreeView is:
 
1. Set the color on my root nodes.  I have that done.
2. Prevent mouseover from highlighting any node.
3. Don't let a selected node change its appearance.

I'm going to attach nodes to root nodes and not any deeper.  I want these nodes to have the empty backcolor and not let any mouseover or doubleclick or any event change that.  My root nodes will have whatever color I finally assign to them and also not show visual changes.

Thank you,
Gary

0
Peter
Telerik team
answered on 17 May 2013, 02:52 PM
Hello Gary,

To remove the MouseOver and Selected style from RadTreeNode please follow these steps:

  • Open Visual Style Builder and load the theme that you are using (Loading predefined themes);
  • In the Controls Structure pane navigate to RadTreeView>>RadTreeViewElement >> TreeNodeElement. In the Element States pane select TreeNodeElement.FullRowSelect.Current and press "Remove all repository item association" (see attached image); Repeat these steps for all states you need (as TreeNodeElement.FullRowSelect.MouseOver, TreeNodeElement.FullRowSelect.Selected etc).
  • Save the theme as a new theme and load it in your application (Saving and Loading Theme FilesLoading Themes from an External FileLoading Themes from a Resource).
I hope my answer is helpful. 

All the best,
Peter
the Telerik team
RadChart for WinForms is obsolete. Now what?
0
Doug
Top achievements
Rank 1
answered on 21 May 2013, 04:38 PM
Thank you, Peter.  It occured to me that if I change a theme it will affect all the TreeViews.  If that's true, I don't want to do that.  I'm constructing a RadDock where the contents in the ToolWindow control the visibility and sequence of the controls on the FlowLayoutPanel in the DocumentWindow (image attached).

ListView won't work because I can't drag/drop using groups.  TreeView has been the easiest choice because it facilitates dragdrop so easily.  I thought that maybe disabling themeing from a single control would eliminate the MouseOver and Selected styles but that didn't work.

So maybe I'll work with two ListViews not in group mode.
0
Peter
Telerik team
answered on 24 May 2013, 01:47 PM
Hello Gary,

Thank you for writing back.

You can modify the theme, then save the theme under a new name, and after that you will be able set this theme only to particular RadListViews:
radListView1.ThemeName  = "MyTheme";

For more information on how to do this and complete steps to achieve this, please refer to the resources that I mention before.

For your scenario you can utilize two ListViews which are not grouped.

Regards,
Peter
Telerik
RadChart for WinForms is obsolete. Now what?
Tags
Treeview
Asked by
Doug
Top achievements
Rank 1
Answers by
Doug
Top achievements
Rank 1
Peter
Telerik team
Share this question
or