Showing posts with label radtreeview. Show all posts
Showing posts with label radtreeview. Show all posts

Wednesday, June 22, 2016

How to show more that one image in the radtreeview item (wpf - telerik )

Leave a Comment

I am adding image to the radtreeviewitem from resources programatically using the below code.

"/myAssembley;component/Resources/image1.png" 

and the image is displaying successfully. Now i need to add another image which needs to be displayed next to the first image in the radtreeviewitem.

how to achieve it.?

Like the below image i need my treeviewitem to display a folder icon and a red square icon in a single treeview item.

enter image description here

2 Answers

Answers 1

If you do not have data binding and you are using RadTreeViewItems directly you can add the additional image in the Header of the item. For example:

var stackPanel = new StackPanel() { Orientation = System.Windows.Controls.Orientation.Horizontal }; var image1 = new Image() { Source = image1Path }; var image2 = new Image() { Source = image2Path }; var textBlock = new TextBlock() { Text = itemHeader }; stackPanel.Children.Add(image1); stackPanel.Children.Add(image2); stackPanel.Children.Add(textBlock);  var treeViewItem = new RadTreeViewItem() {     Header = stackPanel, }; 

It Works.

Answers 2

The proper way would be to create a DataTemplate with a grid or horizontal stackpanel. Put two images inside and in your model two Image Sources that you can bind too. Telerik doesn't have the best track record using the MVVM pattern, but the TreeView control is pretty decent with binding. If you need help with the model and the datatemplate, post some of your code here and we can work on it.

Read More

Monday, May 2, 2016

Node expand box is not visible in Internet explorer and Chrome but is visible in firefox

Leave a Comment

I have a radtreeview in item template of a radcombobox. The parent node is visible but its expand box is not in chrome and IE but its visible in firefox.Image From Firefox

Image from IE

Am i missing something or what can i do to fix this issue.

0 Answers

Read More