Geeks Talk

Prepare for your Next Interview




Treeview Control

This is a discussion on Treeview Control within the C# forums, part of the Software Development category; In the load event of the form, you write code to populate the treeview control namedtvemployees. You declare string variables strdept, stremployee, and strkey for the department,employee, and key ...


Go Back   Geeks Talk > Software Development > C#

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 11-26-2006
Expert Member
 
Join Date: Sep 2005
Posts: 110
Thanks: 8
Thanked 24 Times in 15 Posts
suji is on a distinguished road
Treeview Control

In the load event of the form, you write code to populate the treeview control namedtvemployees. You declare string variables strdept, stremployee, and strkey for the department,employee, and key values needed. You declare node variable nodnew to add nodes to the treeviewcontrol. Which code fragment will populate the treeview control?

(A) set nodnew=tvemployees.nodes.add(key:="root", text: =strdept) setnodnew=tvemployees.nodes.add (relative: ="root", _relationship:=tvwchild, key:=strkey, text:=strempfoyee)

(B) set nodnew=tvemployees.nodes(key:="root", text: =strdept) setnodnew=tvemployees.nodes (relative: ="root", _ relationship:=tvwchild, key:=strkey, text:=strempfoyee)

(C) set nodnew=tvemployees.nodes.add(key:="root") set nodnew=tvemployees.nodes.add(relative: ="root", _ relationship:=tvwchild, key:=strkey, text:=strempfoyee)

(D) set nodnew=tvemployees.nodes(key:="root", text: =strdept) setnodnew=tvemployees.nodes ( relationship:=tvwchild, text:=strempfoyee)
Reply With Quote
The Following User Says Thank You to suji For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 01-29-2008
Junior Member
 
Join Date: Jan 2008
Location: Vancouver, BC, Canada
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
iramley is on a distinguished road
Re: Treeview Control - Ex

// First it is a good practice that you clear what ever nodes there in the tree
// view control. You should do that first:

if (m_oTreeView.Nodes.Count > 0)
{
m_oTreeView.Nodes.Clear();
}


// second: Suppress repainting the TreeView until all the objects have
// been created
m_oTreeView.BeginUpdate();


// then you fill the tree as being expalined in the previous postings


//last Begin repainting the TreeView.
m_oTreeView.EndUpdate();

// then it is an optional that you expand all the tree or not
m_oTreeView.ExpandAll();
Reply With Quote
Reply

  Geeks Talk > Software Development > C#


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Control Break in COBOL timmy MainFrame 5 3 Weeks Ago 04:56 PM
Customer Information Control System Lokesh M MainFrame 2 06-11-2007 10:44 PM
Java - Control Structures Lokesh M Java 0 10-05-2006 06:19 AM
Customer Information Control System Components Lokesh M MainFrame 0 06-19-2006 01:06 AM


All times are GMT -4. The time now is 09:07 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved