Click here to Skip to main content
15,896,207 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: SIP Client using C# Pin
Anonymous20-Sep-05 8:42
Anonymous20-Sep-05 8:42 
GeneralRe: SIP Client using C# Pin
Dario Solera20-Sep-05 9:03
Dario Solera20-Sep-05 9:03 
GeneralRe: SIP Client using C# Pin
enjoycrack20-Sep-05 17:28
enjoycrack20-Sep-05 17:28 
SuggestionRe: SIP Client using C# Pin
Will198410-Jul-12 2:55
Will198410-Jul-12 2:55 
QuestionFile Error Pin
20-Sep-05 4:29
suss20-Sep-05 4:29 
AnswerRe: File Error Pin
Dave Kreskowiak20-Sep-05 8:44
mveDave Kreskowiak20-Sep-05 8:44 
QuestionTreeview deselecting nodes? Pin
PhrankBooth20-Sep-05 4:16
PhrankBooth20-Sep-05 4:16 
AnswerRe: Treeview deselecting nodes? Pin
Paul Voicu20-Sep-05 5:30
Paul Voicu20-Sep-05 5:30 
As far as I know, a treeview can only have one selected node, which you can retrieve with the SelectedNode property.

Therefore, I'm not sure what are you refering to when you say that you have selected *several* nodes - maybe checked, like if the treeview is set to diplay checkboxes, and you refer to the checked nodes?

Anyways, if you want to "deselect" the one and only node that could be selected in a treeview, try setting the SelectedNode property to null.

Otherwise, if you want to "uncheck" any checked node, you must navigate the nodes, say recursively, and set the Checked property of each node to false.

Assuming you have a treeview named treeView in your form, create a method called setCheck and call it from wherever you want to perform the clearing of checked nodes (or checking them for that matter):

<br />
private void setCheck(TreeNode node, bool isChecked) <br />
{<br />
if(node != null) <br />
{<br />
node.Checked = isChecked;<br />
foreach(TreeNode child in node.Nodes) <br />
{<br />
setCheck(child, isChecked);<br />
}<br />
}<br />
}

Call this method like this:
        <br />
//*********************************<br />
bool isChecked = false; //it will clear the check, true will set the check<br />
foreach(TreeNode node in treeView.Nodes) <br />
{<br />
setCheck(node, false);<br />
}<br />
//**********************************


Hope it helps.
AnswerRe: Treeview deselecting nodes? Pin
sreejith ss nair21-Sep-05 22:10
sreejith ss nair21-Sep-05 22:10 
Question&quot;typeloadexception&quot; What is this? How i solve it? Pin
Campaniço20-Sep-05 0:14
Campaniço20-Sep-05 0:14 
Questionhow to take input through telephone Pin
Member 142463519-Sep-05 21:00
Member 142463519-Sep-05 21:00 
AnswerRe: how to take input through telephone Pin
enjoycrack20-Sep-05 17:30
enjoycrack20-Sep-05 17:30 
QuestionProblems with Sockets Pin
Glenn Inman19-Sep-05 5:22
Glenn Inman19-Sep-05 5:22 
QuestionMigratting from Windows CE English version OS to German Pin
Sevu19-Sep-05 1:50
Sevu19-Sep-05 1:50 
QuestionCOM is not working in Windows98se Pin
Nilesh Gambhava17-Sep-05 23:36
Nilesh Gambhava17-Sep-05 23:36 
AnswerRe: COM is not working in Windows98se Pin
Dave Kreskowiak18-Sep-05 1:38
mveDave Kreskowiak18-Sep-05 1:38 
QuestionMinimum security level to... Pin
Ray Cassick17-Sep-05 14:28
Ray Cassick17-Sep-05 14:28 
QuestionMSMQ Pin
chinnasrihari16-Sep-05 19:23
chinnasrihari16-Sep-05 19:23 
QuestionSubType = &quot;Form&quot; or &quot;UserControl&quot; --&gt; SubType = &quot;Code&quot; Pin
Rafferty Uy15-Sep-05 22:25
Rafferty Uy15-Sep-05 22:25 
Questionauto detect new device in windows application Pin
SongDog15-Sep-05 7:28
SongDog15-Sep-05 7:28 
QuestionSystemMonitor ActiveX control and custom performance counters Pin
ivanrachev15-Sep-05 4:38
ivanrachev15-Sep-05 4:38 
QuestionActive document server in .NET Pin
Bruce Pataki15-Sep-05 3:15
Bruce Pataki15-Sep-05 3:15 
QuestionBug in framework? Pin
AlexR12315-Sep-05 2:16
AlexR12315-Sep-05 2:16 
QuestionRegarding the linking of a dll created in .NET Pin
MoQuisha14-Sep-05 20:20
MoQuisha14-Sep-05 20:20 
Questioncompact framework - registering events Pin
David Menéndez Cisterna14-Sep-05 8:48
David Menéndez Cisterna14-Sep-05 8:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.