We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Tree Node Selection

Thread ID:

Created:

Updated:

Platform:

Replies:

14091 May 18,2004 12:02 PM UTC Jul 5,2005 07:26 AM UTC Windows Forms 6
loading
Tags: Tools
Satish
Asked On May 18, 2004 12:02 PM UTC

Hi, How can I Make Tree should always have foucs (Node cannot loose the focus (blue background color). Focus should not go, even if user clicks on any control on the form. Thanks Satish

Sean Greer
Replied On May 18, 2004 01:34 PM UTC

Set the HideSelection property of the TreeViewAdv to false.

Administrator [Syncfusion]
Replied On May 18, 2004 07:48 PM UTC

Hi, Once again, thanks a lot for your response, Sean. Doing the following : this.treeViewAdv1.HideSelection = false; will ensure that the selected node is always highlighted. But when the TreeViewAdv loses focus, the selection rectangle gets grayed out instead of being blue. Please let me know if this works for you. Regards, Guru Patwal Syncfusion, Inc.

Satish
Replied On May 19, 2004 02:23 AM UTC

Hi Guru Patwal, but I need blue background color. Is it possible? Thanks Satish >Hi, > >Once again, thanks a lot for your response, Sean. > >Doing the following : >this.treeViewAdv1.HideSelection = false; > >will ensure that the selected node is always highlighted. But when the TreeViewAdv loses focus, the selection rectangle gets grayed out instead of being blue. Please let me know if this works for you. > >Regards, >Guru Patwal >Syncfusion, Inc.

Administrator [Syncfusion]
Replied On May 19, 2004 11:06 AM UTC

Hi Satish, Yes, you could do so by setting the following properties : this.treeViewAdv1.InactiveSelectedNodeBackground = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.MediumBlue); this.treeViewAdv1.InactiveSelectedNodeForeColor = SystemColors.ActiveCaptionText; Please try this and let me know if this works for you. Thanks for considering Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Sharad Sharma
Replied On July 5, 2005 05:41 AM UTC

Hi Guru Patwal, Can you help me in following code: *************************** private void buttonFindInstruments_Click(object sender, System.EventArgs e) { bool found=false; for (int index = 0 ; index < treeViewAdvProfiles.Nodes.Count ; index++ ) { if (searchNode(treeViewAdvProfiles.Nodes[index])) { found=true; break; } } if (found) { MessageBox.Show("found"); } else { MessageBox.Show("not found"); } } public bool searchNode(TreeNodeAdv treeNode) { string nodeText; bool found=false; for (int index = 0 ; index < treeNode.Nodes.Count ; index++ ) { nodeText = treeNode.Nodes[index].Text; try // temporarily written { if (String.Compare(nodeText, comboBoxInstruments.Text, true)==0) { found=true; // Highlight Node break; } else { searchNode(treeNode.Nodes[index]); } } catch(Exception ex) { ex=ex; // just to trace } } return (found); } *************************** The above searches a node in the treeview for comboBoxInstruments.Text. This code works fine, except, pointing and highlighting the node which is found (matched). I want to write the required code at comment (// Highlight Node) Thanks, Sharad [KAPIL] >Hi Satish, > >Yes, you could do so by setting the following properties : > >this.treeViewAdv1.InactiveSelectedNodeBackground = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.MediumBlue); > >this.treeViewAdv1.InactiveSelectedNodeForeColor = SystemColors.ActiveCaptionText; > >Please try this and let me know if this works for you. Thanks for considering Syncfusion products. > >Regards, >Guru Patwal >Syncfusion, Inc.

Sharad Sharma
Replied On July 5, 2005 07:26 AM UTC

Found solution for abobe issue: just place following code at comment (// Highlight Node) treeViewAdvProfiles.SelectedNode = treeNode.Nodes[index]; treeViewAdvProfiles.Focus(); ...

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;