Solved

remove subitems from silverlight 4 treeview

Posted on 2010-08-28
4
716 Views
Last Modified: 2013-12-17
Anyone that can provide me with a small example on how to remove SUBITEMS from silverlight 4 treeview? Silverlight 4 / VS 2010 / C#
0
Comment
Question by:deeMvee
  • 3
4 Comments
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 33552048
0
 

Author Comment

by:deeMvee
ID: 33552627
"The above code removes root items from the TreeView, not the subitems. To remove sub items, first we need to find the selected item and then we need to call TreeViewItem.Items.RemoveAt method."

How do you find and delete the subitem?
0
 

Accepted Solution

by:
deeMvee earned 0 total points
ID: 33616434
Strange that this is difficult...

Anyway, found a solution:
Just set the visibility for the item to visibility.collapsed and delete it from datasource.
Next time you populate the three it's gone... :) ease and just one line of code...
0
 

Author Comment

by:deeMvee
ID: 33788243
                       TreeViewItem parent = (copyItem).Parent as TreeViewItem;
                        parent.Items.Remove(copyItem); // Cut
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now