CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.internet_explorer_web_controls Tags:
Item Type: NewsGroup Date Entered: 1/27/2004 7:57:25 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 9 Views: 305 Favorited: 0 Favorite
10 Items, 1 Pages 1 |< << Go >> >|
thwarg
Asp.Net User
TreeView - disable postback for selectedindexchange1/27/2004 7:57:25 PM

0

I am using TreeView with AutoPostback=true. This works fine, and I find the postback for expanding/collapsing nodes to be acceptable. What I do not understand is why clicking a node's NavigateUrl causes a postback. I simply want to link to another page, not post back the current one. How can I disable the postback for selectedindexchange?

Thanks
Busara
Asp.Net User
Re: TreeView - disable postback for selectedindexchange2/9/2004 3:00:28 PM

-1

I solved this problem by explicitly clearing the "onselectedindexchange" attribute of the TreeView control, as follows:

tvBrowse.Attributes("onselectedindexchange") = ""

where tvBrowse is my TreeView control. I added this code in the Page_Load segment of my WebForm, on which the TreeView control was placed.

With AutoPostback enabled on the TreeView, I still get my Expand (and Collapse, I presume) server-event in my webform, and selecting/clicking a Node will no longer cause a postback. It will then only use the NavigateUrl property to link to your desired page.

I hope this helped.
Wheat
Asp.Net User
Re: TreeView - disable postback for selectedindexchange2/9/2004 8:27:19 PM

0

hmm..interesting. i wanted the same kinda functionality the other way around. i.e. i didnt want postback on expand/collapse but i wanted postback on selectedindexchange.

so i tried your solution by setting tvwMain.Attributes("oncollapse")="" and tvwMain.Attributes("onexpand")=""

this worked. but when i clicked on a node i got an error:

Exception Details: System.Exception: The node at index 0.0.0.1.0 is not currently displayed in the tree. SelectedNodeIndex cannot be set to an undisplayed node (all parents of a selected node must be expanded).

using a Timer to set the treeview's autopostback didnt seem to work either.
like on the expand and collapse event i set the treeview's autopostback to false and start a timer. 100 ms later in the timer_elapsed event, i reset the tvw's autopostback to true and disable the timer. the second time around the tvw's events werent firing.


Kabindas
Asp.Net User
Re: TreeView - disable postback for selectedindexchange2/10/2004 12:57:45 AM

0

The easy way to enable/disable postbacks on events on the treeview is change the javascript in the treeview.htc file. Example, if u want to disable the postback on expand/colapse node just comment the "fireQueuedEvents();" on the "function nodePlusMinusClick()"
Wheat
Asp.Net User
Re: TreeView - disable postback for selectedindexchange2/10/2004 6:02:23 PM

0

that works! thank you very much
waringmm
Asp.Net User
Re: TreeView - disable postback for selectedindexchange4/5/2004 6:33:52 PM

0

When I tried this solution (comment fireQueuedEvents()), the tree does not load at all.

I'm using SQL and XML.
falcryn
Asp.Net User
Re: TreeView - disable postback for selectedindexchange4/27/2004 5:14:06 PM

0

Same happened here.... I would LOVE to know how to disable the postback on collapse and expand, without getting that error when clicking on an actual node. But making this modification to the treeview file caused the treeview to not build at all.

Thanks
exptrade2000
Asp.Net User
Re: TreeView - disable postback for selectedindexchange4/28/2004 2:16:27 PM

0

Here is how I did it in Treeview.htc



// commnented out to disable postback on expand/collapse
// should post back only when leaf is clicked and added doNodePlusMinusClick(el)
//if (doNodePlusMinusClick(el) == true)
// fireQueuedEvents();
doNodePlusMinusClick(el)


You died at the very end of your life
waringmm
Asp.Net User
Re: TreeView - disable postback for selectedindexchange4/28/2004 3:19:54 PM

0

That did it!

Adding the doNodePlusMinusClick(el) did the trick.

Thanks,

Malcolm
perksy
Asp.Net User
Re: TreeView - disable postback for selectedindexchange9/15/2004 2:17:30 PM

0

************* Edited by moderator Adec ***************
Inserted missing < code></ code> tags. Always include such
tags when including code in your postings. Don't force the
moderators to do this for you. Many readers disregard
postings without the code tags.
**************************************************


Thanks for the above guys. I found, however, that when you collapse a node which is the parent of the currently selected node, then you need to perform the postback anyway. This is because the collapsed node becomes the new selected node.

Here is the revised function in treeview.htc for this enhanced functionality:

function nodePlusMinusClick()
{
if (g_bInteractive == false)
return;

var el = this.parentElement.treenode;

// 2 lines below commented out to disable postback on expand/collapse, extra lines added below for better functionality

// if (doNodePlusMinusClick(el) == true)
// fireQueuedEvents();

var index = getNodeIndex(el);

// if the selected or hovered node was one of the collapsed node's descendants then postback anyway

if (selectedNodeIndex.length > index.length && selectedNodeIndex.substr(0,index.length) == index)
{
if (doNodePlusMinusClick(el) == true)
fireQueuedEvents();
}

// otherwise just do the expand/collapse stuff

else
doNodePlusMinusClick(el);
}
10 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 databases: beta preview Authors: John Kauffman, Thiru Thangarathinam, Pages: 404, Published: 2005

Web:
TreeView - disable postback for selectedindexchange - ASP.NET Forums I simply want to link to another page, not post back the current one. How can I disable the postback for selectedindexchange? ...
TreeView problems: limited AutoPostBack / LinkButton in Node ... But I only want the event SelectedIndexChange to be posted back, because Expand and ... What should I do to disable Expand/Collapse to be posted back? ... hidden.value = treeview.selectedNodeIndex; postback .click(); ...
IceCream - ASP .NET, AJAX, Silverlight, Web 2.0 et cetera ... It's 2008, so we eliminate full page postbacks by using the AJAX .NET Framework. The dropdowns are nicely wrapped inside an UpdatePanel, configured to trigger on SelectedIndexChanged. ... Master Page to make sure every button is disabled while a partial postback is in progress. ... Treeview inside an UpdatePanel ...
How do I save the state of the treeview nodes (expanded/collapsed ... vote up 0 vote down. You can try to enable view state for your tree view control . ... DropDownList doesn't postback on SelectedIndexChanged ...
ASP.NET 2.0 Dropdownlist EnableViewState=false SelectedIndexChange Feb 9, 2006 ... Change value in ddl #1 ... causes postback. SelectedIndexChanged fired for ddl # 1. ..... To illustrate this, disable ViewState and check what the selected index just ...... Treeview update on postback ...

TreeView - disable postback for selectedindexchange - ng.asp-net ... TreeView - disable postback for selectedindexchange, > ROOT > NEWSGROUP > Asp. Net Forum ...
TreeView : Disable link on leaves - ng.asp-net-forum ... TreeView : Disable link on leaves - ng.asp-net-forum ... TreeView - disable postback for selectedindexchange - ASP.NET Forums I simply want ...
Reset a TreeView - ng.asp-net-forum.internet_explorer_web_controls TreeView - disable postback for selectedindexchange - ng.asp-net ... 100 ms later in the timer_elapsed event, i reset the tvw's . ...
collapsed Treeview on page load? - ng.asp-net-forum ... TreeView - disable postback for selectedindexchange - ng.asp-net ... I simply want to link to another page, not post back the current ...
How to: Disable a node of Treeview control dynamically? - ng.asp ... TreeView - disable postback for selectedindexchange - ng.asp-net ... What I do not understand is why clicking a node's NavigateUrl causes a postback. ...






webcontrols

how to deal with the "<" and ">" when using stringwriter to set treeview's src ?

treeview - the data at the root level is invalid??

how to know if the node have child

extending ie web controls

internet explorer webcontrols are not currently supported?

ie web controls are not enabled in toolbox

adding dropdwon button command to toolbar

treeview problem!!!!don't know why?localhost ok but use 192.168.0.75 wrong

treeview with iframe bug

ie tabstrip - need help

do we need to put webctrl_clinet folder under the root ? or can we put it also under the application folder ?

tree view problem

tabstrip generates get /null 404 requests in iislog

what is the "does not match the assembly reference" error ?

the located assembly's manifest definition with name 'microsoft.web.ui.webcontrols' does not match the assembly reference.

treeview - need user feedback when opening large nodes

install and build web controls guide

treeview server control problem

filling tree node

programatically progress through tree nodes

asp.net site for all browsers

"link" some imagebutton to a treeview

the tabstrip control work on asp.net 2.0 ???

treeview question

page.navigate()

web form layout

toolbarcheckbutton question

separating autopostback functionality treeview control

treeview - output problem

   
  Privacy | Contact Us
All Times Are GMT