Prepare for your Next Interview
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 ...
|
|||
|
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) |
| The Following User Says Thank You to suji For This Useful Post: | ||
| Sponsored Links |
|
|||
|
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(); |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| 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 |