Click here to Skip to main content
15,909,325 members

Comments by sandeep sangshetty (Top 2 by date)

sandeep sangshetty 18-Dec-12 8:07am View    
I tried to populate the internal nodes only when that upper node is selected but I want this to be happened before selecting the node itself.

Code as follows........

public List<string> ScriptCmnd(string s)
{

si.StartInfo.Arguments = s;
si.Start();
string output = si.StandardOutput.ReadToEnd();
List<string> result = output.Split('\n').ToList<string>();
si.Close();
return result;
}

private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
if ( e.Node.Level != 0)
{
string removeStr = "Project.pj";
List<string> result = ScriptCmnd("/c si viewproject --no --fields=name --project='" + e.Node.Name);
result.RemoveAll(x => x == "" || !(x.Contains("project.pj")));
if (result.Count != 0)
{
foreach (string sr in result)
{
TreeNode trChild = new TreeNode();
trChild.Text = sr;
trChild.Name = e.Node.Name.Remove(e.Node.Name.IndexOf(removeStr, StringComparison.OrdinalIgnoreCase), removeStr.Length) + sr;

treeView1.SelectedNode.Nodes.Add(trChild);
treeView1.SelectedNode.ExpandAll();
}
}
}
}
sandeep sangshetty 1-Dec-10 1:38am View    
Thanks for ur reply.

I want to have the siteIds in sepreate table for the future sites.
So in order to refer the state specific data i need to add the new column 'SiteId' in each and every table ,But while retrieving it may take lot of time.
This may degrades the performance of the site.