Click here to Skip to main content
15,914,481 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: creating dynamic row in datagrid in asp.net1.1 Pin
Rahithi10-Jan-07 18:28
Rahithi10-Jan-07 18:28 
Questionhow to register asp.net regiis Pin
dhulipudi10-Jan-07 16:02
dhulipudi10-Jan-07 16:02 
AnswerRe: how to register asp.net regiis Pin
Rama Krishna Vavilala10-Jan-07 16:20
Rama Krishna Vavilala10-Jan-07 16:20 
QuestionA challenge seems to be simple [modified] Pin
nxde200010-Jan-07 15:58
nxde200010-Jan-07 15:58 
QuestionMigration from VS2003 to VS 2005 Pin
mageshsmk10-Jan-07 15:32
mageshsmk10-Jan-07 15:32 
QuestionThe process cannot access the file 'bin\Debug\ MyProject.exe' Pin
JaneQuestion10-Jan-07 15:13
JaneQuestion10-Jan-07 15:13 
AnswerRe: The process cannot access the file 'bin\Debug\ MyProject.exe' Pin
minhpc_bk10-Jan-07 23:30
minhpc_bk10-Jan-07 23:30 
QuestionSelectedNodeChanged Event not Firing and tree disappearing in Treeview Pin
C# Tea Boy10-Jan-07 12:56
C# Tea Boy10-Jan-07 12:56 
Hi All,

Newbie question !!

I have a placeholder on a standard aspx page. In page_load i create a treeview and fill it .. "phDirList" is the placeholder. ListDirectories adds a new node per directory and calls itself again for any subdirectories, it also returns a list of the directories for my use later.

if (!Page.IsPostBack)
{
phDirList.Controls.Clear();
phFileList.Controls.Clear();

// get home directory first
String AppPath = Request.ServerVariables["PATH_TRANSLATED"];

// get rid of the page name and replace with document root
int i = AppPath.LastIndexOf("\\");
AppPath = AppPath.Substring(0, i + 1);
AppPath = AppPath + "Documents\\";

// Create treeview and set event Handler
TreeView treeView = new TreeView();
treeView.SelectedNodeChanged += new EventHandler(Node_Change);

// Set node and action to SELECT
TreeNode rootNode = new TreeNode();
rootNode.Text = "Documents";
rootNode.Value = AppPath;
rootNode.NavigateUrl = String.Empty;
rootNode.SelectAction = TreeNodeSelectAction.Select;

// list directories etc
List<string> rootDir = Utility.ListDirectories(AppPath, rootNode, true);

treeView.Nodes.Add(rootNode);
rootNode.CollapseAll();
phDirList.Controls.Add(treeView);

} // end IsPostBack

I then have Node_Change defined as ...
public void Node_Change(object sender, EventArgs args)
{
// do stuff ....
}

The tree looks fine to start with but then the problems begin ... problem is two fold ...

1. The event handler never fires. I have read bits on other posts about setting the SelectionAction to Select for items that should call the SelectedNodeChanged handler, and also that setting NavigationURL to an emtpy string forces the node into selection mode rather than navigation .... but the event handler still does not fire.

2. After clicking a node, the tree disappears !!!

Any help that can be offered is most appreciated.
AnswerRe: SelectedNodeChanged Event not Firing and tree disappearing in Treeview Pin
minhpc_bk10-Jan-07 13:28
minhpc_bk10-Jan-07 13:28 
GeneralRe: SelectedNodeChanged Event not Firing and tree disappearing in Treeview Pin
C# Tea Boy10-Jan-07 22:58
C# Tea Boy10-Jan-07 22:58 
QuestionGridview Pin
vasini10-Jan-07 10:15
vasini10-Jan-07 10:15 
AnswerRe: Gridview Pin
Christian Graus10-Jan-07 11:46
protectorChristian Graus10-Jan-07 11:46 
Questionproblem showing SWF in asp Pin
sanaziuse10-Jan-07 8:18
sanaziuse10-Jan-07 8:18 
AnswerRe: problem showing SWF in asp Pin
Pete O'Hanlon10-Jan-07 8:47
mvePete O'Hanlon10-Jan-07 8:47 
GeneralRe: problem showing SWF in asp Pin
sanaziuse10-Jan-07 8:59
sanaziuse10-Jan-07 8:59 
GeneralRe: problem showing SWF in asp Pin
Christian Graus10-Jan-07 11:51
protectorChristian Graus10-Jan-07 11:51 
GeneralRe: problem showing SWF in asp Pin
sanaziuse10-Jan-07 23:07
sanaziuse10-Jan-07 23:07 
Question[Message Deleted] Pin
saravanan0510-Jan-07 6:07
saravanan0510-Jan-07 6:07 
AnswerRe: session Pin
Not Active10-Jan-07 6:22
mentorNot Active10-Jan-07 6:22 
GeneralRe: session Pin
ednrgc10-Jan-07 6:58
ednrgc10-Jan-07 6:58 
AnswerRe: session Pin
Guffa10-Jan-07 9:45
Guffa10-Jan-07 9:45 
GeneralRe: session Pin
saravanan0510-Jan-07 10:03
saravanan0510-Jan-07 10:03 
AnswerRe: session Pin
Guffa10-Jan-07 10:12
Guffa10-Jan-07 10:12 
QuestionPurpose of creating user controls in .net Pin
vijay_8310-Jan-07 6:00
vijay_8310-Jan-07 6:00 
AnswerRe: Purpose of creating user controls in .net Pin
ednrgc10-Jan-07 6:59
ednrgc10-Jan-07 6:59 

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.