TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Francesco
NA
1
0
Search a Node in TreeView
Dec 18 2007 4:55 AM
Hello everybody...
I have to develop a button for a search node in treeview, on this site I found this code, but when I try it on my environment
tn.Length is always 0...
can anyone help me please???!!!
private void cerca_Click(object sender, EventArgs e)
{
ResetPMInfo();
ResetForm();
string TextSQL = "SELECT * FROM PM_TREE_VIEW WHERE TYPE=1 AND CODE_PREFIX like '%" + textCerca.Text + "%'";
DBHandler dbHand = new DBHandler();
CodePrefix = (string)dbHand.GetField(TextSQL, "CODE_PREFIX");
TreeNode Node = new TreeNode();
Node.Text = CodePrefix;
//the code took from this site
try
{
TreeNode[] tn = PlannedMaintenance_MainTreeView.Nodes[0].Nodes.Find(Node.Text, true);
for (int i = 0; i < tn.Length; i++)
{
PlannedMaintenance_MainTreeView.SelectedNode = tn[i];
PlannedMaintenance_MainTreeView.SelectedNode.BackColor = Color.Blue;
}
}
catch { }
this.Cursor = Cursors.AppStarting;
LoadPMList();
this.Cursor = Cursors.Default;
}
Reply
Answers (
0
)
retrieve service name at run-time
html editor