Click here to Skip to main content
15,915,702 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: GridView & CheckBox [modified] Pin
comp_j27-Jul-09 10:28
comp_j27-Jul-09 10:28 
AnswerRe: GridView & CheckBox Pin
Abhijit Jana27-Jul-09 10:39
professionalAbhijit Jana27-Jul-09 10:39 
AnswerRe: GridView & CheckBox Pin
bonypatel27-Jul-09 22:26
bonypatel27-Jul-09 22:26 
QuestionFixed table header Pin
indian14327-Jul-09 3:34
indian14327-Jul-09 3:34 
AnswerRe: Fixed table header Pin
Blikkies27-Jul-09 3:37
professionalBlikkies27-Jul-09 3:37 
GeneralRe: Fixed table header Pin
indian14327-Jul-09 19:42
indian14327-Jul-09 19:42 
AnswerRe: Fixed table header Pin
Abhishek Sur27-Jul-09 8:12
professionalAbhishek Sur27-Jul-09 8:12 
QuestionExecute LINQ query Pin
zeeShan anSari27-Jul-09 3:13
zeeShan anSari27-Jul-09 3:13 
AnswerRe: Execute LINQ query Pin
Tamer Oz27-Jul-09 4:18
Tamer Oz27-Jul-09 4:18 
GeneralRe: Execute LINQ query Pin
zeeShan anSari27-Jul-09 4:20
zeeShan anSari27-Jul-09 4:20 
GeneralRe: Execute LINQ query Pin
Tamer Oz27-Jul-09 4:25
Tamer Oz27-Jul-09 4:25 
QuestionPromp box in the center of screen Pin
deep727-Jul-09 3:09
deep727-Jul-09 3:09 
AnswerRe: Promp box in the center of screen Pin
Abhijit Jana27-Jul-09 3:35
professionalAbhijit Jana27-Jul-09 3:35 
GeneralRe: Promp box in the center of screen Pin
deep727-Jul-09 23:13
deep727-Jul-09 23:13 
AnswerRe: Promp box in the center of screen Pin
Blue_Boy27-Jul-09 3:37
Blue_Boy27-Jul-09 3:37 
GeneralRe: Promp box in the center of screen Pin
Abhijit Jana27-Jul-09 3:41
professionalAbhijit Jana27-Jul-09 3:41 
GeneralRe: Promp box in the center of screen Pin
Blue_Boy27-Jul-09 3:52
Blue_Boy27-Jul-09 3:52 
GeneralRe: Promp box in the center of screen Pin
Abhijit Jana27-Jul-09 3:54
professionalAbhijit Jana27-Jul-09 3:54 
GeneralRe: Promp box in the center of screen Pin
Blue_Boy27-Jul-09 3:57
Blue_Boy27-Jul-09 3:57 
GeneralRe: Promp box in the center of screen Pin
Viral Upadhyay27-Jul-09 4:17
Viral Upadhyay27-Jul-09 4:17 
GeneralRe: Promp box in the center of screen Pin
Blue_Boy27-Jul-09 4:19
Blue_Boy27-Jul-09 4:19 
AnswerRe: Promp box in the center of screen Pin
ToddHileHoffer27-Jul-09 7:11
ToddHileHoffer27-Jul-09 7:11 
Questionproblem with ajax control DragDropExtender Pin
S.Aijaz27-Jul-09 2:37
S.Aijaz27-Jul-09 2:37 
QuestionDynamic Treeview - (problem with nodes getting multiplied) Pin
sigurdur einarsson27-Jul-09 2:17
sigurdur einarsson27-Jul-09 2:17 
Hello, Ive got a problem with all new sub nodes in a treeview getting multiplied with every postback

--------------------------- (GOOD) before any node check change ---------------
node1
node2
node3

--------------------------- (GOOD) after checking node 1 ---------------
node1
subnode1:113424
subnode2:113424
subnode3:113424
node2
node3

--------------------------- (BAD) after checking node 2 ---------------
node1
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
node2
subnode1:113431
subnode2:113431
subnode3:113431
node3

---------------------------(BAD) after checking node 3 ---------------
node1
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
node2
subnode1:113431
subnode2:113431
subnode3:113431
subnode1:113431
subnode2:113431
subnode3:113431
node3
subnode1:113434
subnode2:113434

------------------- ASP code -----------------------

<body>
<form id="form1" runat="server">
<div>
<asp:PlaceHolder ID="PHForTree" runat=server ></asp:PlaceHolder>
</div>
</form>
</body>


---------------- Code behind --------------

protected void Page_Load(object sender, EventArgs e)
{
TreeView obTreeView = null;
if (IsPostBack == false)
{
obTreeView = new TreeView();

obTreeView.Nodes.Add(new TreeNode("node1"));
obTreeView.Nodes.Add(new TreeNode("node2"));
obTreeView.Nodes.Add(new TreeNode("node3"));
Session["m_obTreeView"] = obTreeView;
}
else
obTreeView = (TreeView)Session["m_obTreeView"];

obTreeView.SelectedNodeChanged += new EventHandler(this.Node_Change);
PHForTree.Controls.Add(obTreeView);
}

void Node_Change(object sender, EventArgs e)
{
TreeView obTreeView = (TreeView)Session["m_obTreeView"];
string strDateTimeStamp = DateTime.Now.ToString("hhmmss");
obTreeView.SelectedNode.ChildNodes.Add(new TreeNode("subnode1:" + strDateTimeStamp));
obTreeView.SelectedNode.ChildNodes.Add(new TreeNode("subnode2:" + strDateTimeStamp));
obTreeView.SelectedNode.ChildNodes.Add(new TreeNode("subnode3:" + strDateTimeStamp));

Session["m_obTreeView"] = obTreeView;
}


I hope someone can help,....

With Regards, Siggi
AnswerRe: Dynamic Treeview - (problem with nodes getting multiplied) Pin
Blue_Boy27-Jul-09 2:35
Blue_Boy27-Jul-09 2:35 

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.