Showing posts with label nodes. Show all posts
Showing posts with label nodes. Show all posts

Wednesday, March 28, 2012

Treeview acting strange in UpdatePanel

We are having issues with a treeview in an updatepanel with the RC release. When we click a child node, sometimes it closes other nodes at the same level. When a closed node is expanded again, it has a child node that is expanded. It looks like the treeview is mixing up an opened node with one of its child nodes. If we take it out of an update panel, it works fine, but does full postbacks at every click. Any ideas how to fix this problem?

treeview is not supported by Ajax.NET (I heard rumours about Q3 Orcas -related update)

do search in the forum


I have been searching, but didn't find much. It is just yet another ASP.NET control that isn't supported with UpdatePanels since the CTPs...

I would say treeview made troubles even in CTPs...

this control is discussed quite often here, even the post preceding yours mentions that...

http://forums.asp.net/thread/1514853.aspx


It worked fine for us before, and the menu also did. We were also able to use ReportViewers without having to do a full postback, which you have had to since the Betas.

I am really disappointed that Menu and TreeView controls are not supported in ASP.Net AJAX UpdatePanels. I have a production website that successfully uses Menu and TreeView controls in UpdatePanels using the July CTP of Atlas. Sounds like I will never be able to upgrade to the fully supported ASP.Net AJAX version. I know that the TreeView control can do an asynchronous callback for the TreeNodePopulate event, but I also need partial page postbacks for the SelectedNodeChanged event. In fact, I want PopulateNodesFromClient to be false anyway otherwise the atlas UpdateProgress control does not appear for TreeNodePopulate event asynchronous callbacks. And I extensively use Menu controls to create tabstrips in combination with a MultiView control. I hope Menu and Treeview support can still be added to the final version of ASP.Net AJAX.

Remco

Treeview and beta1

Can I use a Treeview inside UpdatePanel in Beta1?

I need to add/remove nodes from the Treeview, it would be nice to have this handled by the UpdatePanel.

Treeview is not supported in Beta1. I had the same issue.. sorry to deliver the bad news :(

Treeview Control How can I trap a callback function

In my web application I have an Ajax Treeview control which populates its child nodes via AJAX, and all is working beautifully except that all our pages turn on a "spinny" image whenever there is a postback either full or partial my problem is how can I trap the completion of the ajax postback so I can turn the spinny off?

I cannot find a treeview event that I can trap on the client side to do this.

I expect someone has ran into this issue before so any help would be gratly appriciated.

I have only recently started using AJAX and so far everything I have seen has been really good but I would to solve this issue.

Cheers

John

How are you populating the tree? What "Ajax Treeview control" are you using?

You should be able to attach a callback handler that will let you get rid of the "spinny", but without knowing your approach I can't recommend how to do this in your instance.

-Damien


Hi Damien

Here is the markup for the treeview I have removed the styling for berevity

<asp:TreeViewID="tvwProcess"runat="server"EnableClientScript="true"OnTreeNodePopulate="GetChildren"PopulateNodesFromClient="true"Style="overflow: auto; height: 490px">

</asp:TreeView>

GetChildren is a serverside method which populates the expanded node

Does this give you enough info?

Thanks

John


You should be able to use the ClientScript.GetCallbackEventReference to get a reference to the callback and then hide the image using the callback method (seehttp://west-wind.com/weblog/posts/2302.aspx for an example).

Hope this helps...

-Damien


Hi Damien

re:

You should be able to use the ClientScript.GetCallbackEventReference to get a reference to the callback and then hide the image using the callback method (seehttp://west-wind.com/weblog/posts/2302.aspx for an example).

I tried your suggestion and got the example from west-wind working fine and also this example from Microsoft http://msdn2.microsoft.com/en-us/library/ms153106.aspx

the problem I still have with the treeview is what event to attach it to. The logical option would be the "OnTreeNodeExpanded" but that looks for a server side methodAm I missing something?CheersJohn

Hi,

At the client side,the"OnTreeNodeExpanded" is the click event of the parent Node.

Treeview in modal dialog

I have a modal dialog extender that displays a panel when a button is clicked on the screen. There is a treeview in the panel that has 1...n nodes in it. The panel gets visible just fine, Ok and Cancel buttons work right, but I have a problem with the treeview. When I click on a node in the treeview, modal dialog dissapears from the screen. I've added the treeview to update panel but that didn't work, eighter. Does anyone have had this same problem?

Hello,

I believe treeviews have there own ajax like behaviors and you may be experiencing a postback when the node is clicked.

Can you try to set the property below on your treeview?

EnableClientScript ="False"

Also, is the treeview causing a postback whne you click it? If so, you may need to show the modal dialog extender again after the postback.

Good luck,

Louis

treeview in update panel does not show styles such as background color,fore color, etc

i have changed the backcolor of my treeview nodes and selected nodes to different colors

wheni draw the treeview outside a updatepanel it shows the colors,

however if I draw it inside the updatepanel it does not show the colors

any help?

Try to post some of your codes here.I'd like to check this. Try to specify postback for the asp:TreeView.
Here are some sample codes about asp:TreeView for your reference.
<WebPart:webpartmanager id="WebPartManager1" runat="server" Personalization-Enabled="true"></WebPart:webpartmanager>
<WebPart:webpartzone id="WebPartZone1" runat="server" bordercolor="#CCCCCC" font-names="Verdana"
padding="6" width="169px">
<PartChromeStyle BackColor="#F7F6F3" ForeColor="White" BorderColor="#E2DED6" Font-Names="Verdana"></PartChromeStyle>
<MenuLabelHoverStyle ForeColor="#E2DED6"></MenuLabelHoverStyle>
<EmptyZoneTextStyle Font-Size="0.8em"></EmptyZoneTextStyle>
<MenuLabelStyle ForeColor="White"></MenuLabelStyle>
<MenuVerbHoverStyle BackColor="#F7F6F3" BorderStyle="Solid" ForeColor="#333333" BorderWidth="1px" BorderColor="#CCCCCC"></MenuVerbHoverStyle>
<HeaderStyle ForeColor="#CCCCCC" HorizontalAlign="Center" Font-Size="0.7em"></HeaderStyle>
<MenuVerbStyle BorderStyle="Solid" ForeColor="White" BorderWidth="1px" BorderColor="#5D7B9D"></MenuVerbStyle>
<PartStyle ForeColor="#333333" Font-Size="0.8em"></PartStyle>
<TitleBarVerbStyle ForeColor="White" Font-Size="0.6em" Font-Underline="False"></TitleBarVerbStyle>
<MenuPopupStyle BackColor="#5D7B9D" BorderWidth="1px" BorderColor="#CCCCCC" Font-Size="0.6em" Font-Names="Verdana"></MenuPopupStyle>
<PartTitleStyle BackColor="#5D7B9D" ForeColor="White" Font-Size="0.8em" Font-Bold="True"></PartTitleStyle>
<ZoneTemplate>
<asp:TextBox ID="tbWebPart" runat="server" Height="19px" Width="197px"></asp:TextBox>
<asp:UpdatePanel ID="upTree" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" AutoGenerateRows="False" DataSourceID="SqlDataSource1" AllowPaging="True" CellPadding="4" ForeColor="Black" GridLines="Vertical" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px">
<Fields>
<asp:TemplateField>
<ItemTemplate>
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode Text="File" Value="File">
<asp:TreeNode Text="New" Value="New"></asp:TreeNode>
<asp:TreeNode Text="Open" Value="Open"></asp:TreeNode>
<asp:TreeNode Text="Exit" Value="Exit"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Edit" Value="Edit"></asp:TreeNode>
<asp:TreeNode Text="WebSite" Value="WebSite"></asp:TreeNode>
<asp:TreeNode Text="Build" Value="Build"></asp:TreeNode>
<asp:TreeNode Text="Debug" Value="Debug"></asp:TreeNode>
<asp:TreeNode Text="Format" Value="Format"></asp:TreeNode>
<asp:TreeNode Text="Help" Value="Help"></asp:TreeNode>
</Nodes>
</asp:TreeView>
</ItemTemplate>
<EditItemTemplate>
<asp:TreeView ID="TreeView2" runat="server" ShowCheckBoxes="All">
<Nodes>
<asp:TreeNode Text="File" Value="File">
<asp:TreeNode Text="New" Value="New"></asp:TreeNode>
<asp:TreeNode Text="Open" Value="Open"></asp:TreeNode>
<asp:TreeNode Text="Exit" Value="Exit"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Edit" Value="Edit"></asp:TreeNode>
<asp:TreeNode Text="WebSite" Value="WebSite"></asp:TreeNode>
<asp:TreeNode Text="Build" Value="Build"></asp:TreeNode>
<asp:TreeNode Text="Debug" Value="Debug"></asp:TreeNode>
<asp:TreeNode Text="Format" Value="Format"></asp:TreeNode>
<asp:TreeNode Text="Help" Value="Help"></asp:TreeNode>
</Nodes>
</asp:TreeView>
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ProductID" HeaderText="ProductID" InsertVisible="False"
ReadOnly="True" SortExpression="ProductID" />
<asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" />
<asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice" SortExpression="UnitPrice" />
<asp:CommandField ShowEditButton="True" />
</Fields>
<FooterStyle BackColor="#CCCC99" />
<EditRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#F7F7DE" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ProductConnectionString %>"
SelectCommand="SELECT [ProductID], [ProductName], [UnitPrice] FROM [Product]" DeleteCommand="DELETE FROM [Product] WHERE [ProductID] = @.ProductID" InsertCommand="INSERT INTO [Product] ([ProductName], [UnitPrice]) VALUES (@.ProductName, @.UnitPrice)" UpdateCommand="UPDATE [Product] SET [ProductName] = @.ProductName, [UnitPrice] = @.UnitPrice WHERE [ProductID] = @.ProductID">
<DeleteParameters>
<asp:Parameter Name="ProductID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ProductName" Type="String" />
<asp:Parameter Name="UnitPrice" Type="Double" />
<asp:Parameter Name="ProductID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ProductName" Type="String" />
<asp:Parameter Name="UnitPrice" Type="Double" />
</InsertParameters>
</asp:SqlDataSource>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="DetailsView1" />
</Triggers>
</asp:UpdatePanel>
</ZoneTemplate>
</WebPart:webpartzone>
</div
Wish the above can help you.

Monday, March 26, 2012

Treeview inside update panel adds nodes when expanded/collapsed

Hi all,

I have something weird going on with a page with 3 treeview controls. I have them set to be expanded by default, but when I click on the collapse (or expand) image on any of the 3 treeviews, a new node is added in my second treeview with repeating data, ie:

TreeView1

1.01.11.22.02.1

TreeView2

3.03.13.2

Now, if I click on 2.0 to collapse it, a new node in TreeView2 will appear, same as 3.0. If I expand 2.0 again, or collapse another node, 3.0 is added again to TreeView2. I'm getting the data from a database table.

Here is the page behind:

protected void Page_Load(object sender, EventArgs e) {if (!Page.IsPostBack) PopulateRootLevel(); PopulateRootLevel_OD(); PopulateRootLevel_RO(); }//TreeView 1//private void PopulateRootLevel() { SqlConnection objConn =new SqlConnection("Data Source=##;Initial Catalog=##;Integrated Security=True"); SqlCommand objCommand =new SqlCommand("select *,(select count(*) FROM ccForum_Posts WHERE parentid=sc.id) childnodecount FROM ccForum_Posts sc where parentID='0' AND status='ac' AND sticky='1' ORDER BY DateTime", objConn); SqlDataAdapter da =new SqlDataAdapter(objCommand); DataTable dt =new DataTable(); da.Fill(dt); PopulateNodes(dt, TreeView1.Nodes); }private void PopulateSubLevel(int parentid, TreeNode parentNode) { SqlConnection objConn =new SqlConnection("Data Source=##;Initial Catalog=##;Integrated Security=True"); SqlCommand objCommand =new SqlCommand("select *,(select count(*) FROM ccForum_Posts WHERE parentid=sc.id) childnodecount FROM ccForum_Posts sc where parentID=@dotnet.itags.org.parentID AND status='ac' ORDER BY sticky, DateTime", objConn); objCommand.Parameters.Add("@dotnet.itags.org.parentID", SqlDbType.Int).Value = parentid; SqlDataAdapter da =new SqlDataAdapter(objCommand); DataTable dt =new DataTable(); da.Fill(dt); PopulateNodes(dt, parentNode.ChildNodes); }protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { PopulateSubLevel(Int32.Parse(e.Node.Value), e.Node); }private void PopulateNodes(DataTable dt, TreeNodeCollection nodes) {foreach (DataRow drin dt.Rows) { TreeNode tn =new TreeNode(); tn.ToolTip = dr["Message"].ToString(); tn.Text = dr["subject"].ToString() +" - <span style=font-size:xx-small;> by " + dr["Author"].ToString() +" on " + dr["DateTime"].ToString() +"</span>"; tn.Value = dr["id"].ToString(); tn.NavigateUrl ="~/Post.aspx?MID=" + dr["id"].ToString() +"&PID=" + dr["PostID"].ToString(); nodes.Add(tn);//If node has child nodes, then enable on-demand populating tn.PopulateOnDemand = ((int)(dr["childnodecount"]) > 0); } }protected void Button_Command(Object sender, CommandEventArgs e) {switch (e.CommandName) {case"Expand": TreeView1.ExpandAll();break;case"Collapse": TreeView1.CollapseAll();break;default:// Do nothing.break; } }//TreeView 2//private void PopulateRootLevel_OD() { SqlConnection objConn_OD =new SqlConnection("Data Source=##;Initial Catalog=##;Integrated Security=True"); SqlCommand objCommand_OD =new SqlCommand("select *,(select count(*) FROM ccForum_Posts WHERE parentid=sc.id) childnodecount FROM ccForum_Posts sc where parentID='0' AND status='ac' AND sticky='2' ORDER BY DateTime", objConn_OD); SqlDataAdapter da_OD =new SqlDataAdapter(objCommand_OD); DataTable dt_OD =new DataTable(); da_OD.Fill(dt_OD); PopulateNodes_OD(dt_OD, TreeView2.Nodes); }private void PopulateSubLevel_OD(int parentid, TreeNode parentNode) { SqlConnection objConn =new SqlConnection("Data Source=##;Initial Catalog=##;Integrated Security=True"); SqlCommand objCommand =new SqlCommand("select *,(select count(*) FROM ccForum_Posts WHERE parentid=sc.id) childnodecount FROM ccForum_Posts sc where parentID=@dotnet.itags.org.parentID AND status='ac' ORDER BY sticky, DateTime", objConn); objCommand.Parameters.Add("@dotnet.itags.org.parentID", SqlDbType.Int).Value = parentid; SqlDataAdapter da =new SqlDataAdapter(objCommand); DataTable dt =new DataTable(); da.Fill(dt); PopulateNodes_OD(dt, parentNode.ChildNodes); }protected void TreeView2_TreeNodePopulate(object sender, TreeNodeEventArgs e) { PopulateSubLevel_OD(Int32.Parse(e.Node.Value), e.Node); }private void PopulateNodes_OD(DataTable dt, TreeNodeCollection nodes) {foreach (DataRow drin dt.Rows) { TreeNode tn =new TreeNode(); tn.ToolTip = dr["Message"].ToString(); tn.Text = dr["subject"].ToString() +" - <span style=font-size:xx-small;> by " + dr["Author"].ToString() +" on " + dr["DateTime"].ToString() +"</span>"; tn.Value = dr["id"].ToString(); tn.NavigateUrl ="~/Post.aspx?MID=" + dr["id"].ToString() +"&PID=" + dr["PostID"].ToString(); nodes.Add(tn);//If node has child nodes, then enable on-demand populating tn.PopulateOnDemand = ((int)(dr["childnodecount"]) > 0); } }protected void Button_Command_OD(Object sender, CommandEventArgs e) {switch (e.CommandName) {case"Expand": TreeView2.ExpandAll();break;case"Collapse": TreeView2.CollapseAll();break;default:// Do nothing.break; } }//TreeView 3//private void PopulateRootLevel_RO() { SqlConnection objConn =new SqlConnection("Data Source=##;Initial Catalog=##;Integrated Security=True"); SqlCommand objCommand =new SqlCommand("select *,(select count(*) FROM ccForum_Posts WHERE parentid=sc.id) childnodecount FROM ccForum_Posts sc where parentID='0' AND status='ro' ORDER BY sticky, DateTime", objConn); SqlDataAdapter da =new SqlDataAdapter(objCommand); DataTable dt =new DataTable(); da.Fill(dt); PopulateNodes_RO(dt, TreeView3.Nodes); }private void PopulateSubLevel_RO(int parentid, TreeNode parentNode) { SqlConnection objConn =new SqlConnection("Data Source=##;Initial Catalog=##;Integrated Security=True"); SqlCommand objCommand =new SqlCommand("select *,(select count(*) FROM ccForum_Posts WHERE parentid=sc.id) childnodecount FROM ccForum_Posts sc where parentID=@dotnet.itags.org.parentID ORDER BY DateTime", objConn); objCommand.Parameters.Add("@dotnet.itags.org.parentID", SqlDbType.Int).Value = parentid; SqlDataAdapter da =new SqlDataAdapter(objCommand); DataTable dt =new DataTable(); da.Fill(dt); PopulateNodes_RO(dt, parentNode.ChildNodes); }protected void TreeView3_TreeNodePopulate(object sender, TreeNodeEventArgs e) { PopulateSubLevel_RO(Int32.Parse(e.Node.Value), e.Node); }private void PopulateNodes_RO(DataTable dt, TreeNodeCollection nodes) {foreach (DataRow drin dt.Rows) { TreeNode tn =new TreeNode(); tn.ToolTip = dr["Message"].ToString(); tn.Text = dr["subject"].ToString() +" - <span style=font-size:xx-small;> by " + dr["Author"].ToString() +" on " + dr["DateTime"].ToString() +"</span>"; tn.Value = dr["id"].ToString(); tn.NavigateUrl ="~/Post.aspx?MID=" + dr["id"].ToString() +"&PID=" + dr["PostID"].ToString(); nodes.Add(tn);//If node has child nodes, then enable on-demand populating tn.PopulateOnDemand = ((int)(dr["childnodecount"]) > 0); } }protected void Button_Command_RO(Object sender, CommandEventArgs e) {switch (e.CommandName) {case"Expand": TreeView3.ExpandAll();break;case"Collapse": TreeView3.CollapseAll();break;default:// Do nothing.break; } }

And here is the control:

<%@dotnet.itags.org. Control Language="C#" AutoEventWireup="true" CodeFile="ct_forum_2.ascx.cs" Inherits="ccforum_ct_forum" %><asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <h3>TreeView1 - <asp:ImageButton ID="ExpandButton" runat="server" ImageUrl="~/images/expandall.jpg" CommandName="Expand" OnCommand="Button_Command" AlternateText="Open All Conversations" />   <asp:ImageButton ID="CollapseButton" runat="server" ImageUrl="~/images/collapseall.jpg" CommandName="Collapse" OnCommand="Button_Command" AlternateText="Close All Conversations" /></h3> <asp:TreeView ID="TreeView1" ExpandDepth="10" runat="server" OnTreeNodePopulate="TreeView1_TreeNodePopulate" ImageSet="Inbox" EnableClientScript="False" Width="100%" BackColor="White" BorderColor="#404040" LineImagesFolder="~/TreeLineImages" ShowLines="True" > <ParentNodeStyle Font-Bold="False" /> <HoverNodeStyle Font-Underline="True" /> <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px" BackColor="#404040" /> <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" /> </asp:TreeView><br /> <h3>TreeView2 - <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/expandall.jpg" CommandName="Expand" OnCommand="Button_Command_OD" AlternateText="Open All Conversations" />   <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/collapseall.jpg" CommandName="Collapse" OnCommand="Button_Command_OD" AlternateText="Close All Conversations" /></h3> <asp:TreeView ID="TreeView2" ExpandDepth="10" runat="server" OnTreeNodePopulate="TreeView2_TreeNodePopulate" ImageSet="Inbox" EnableClientScript="False" Width="100%" BackColor="White" BorderColor="#404040" LineImagesFolder="~/TreeLineImages" ShowLines="True" > <ParentNodeStyle Font-Bold="False" /> <HoverNodeStyle Font-Underline="True" /> <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px" BackColor="#404040" /> <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" /> </asp:TreeView> <br /> <h3>TreeView3 - <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/images/expandall.jpg" CommandName="Expand" OnCommand="Button_Command_RO" AlternateText="Open All Conversations" />   <asp:ImageButton ID="ImageButton4" runat="server" ImageUrl="~/images/collapseall.jpg" CommandName="Collapse" OnCommand="Button_Command_RO" AlternateText="Close All Conversations" /></h3> <asp:TreeView ID="TreeView3" ExpandDepth="10" runat="server" OnTreeNodePopulate="TreeView3_TreeNodePopulate" ImageSet="Inbox" EnableClientScript="False" Width="100%" BackColor="White" BorderColor="#404040" LineImagesFolder="~/TreeLineImages" ShowLines="True" > <ParentNodeStyle Font-Bold="False" /> <HoverNodeStyle Font-Underline="True" /> <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px" BackColor="#404040" /> <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" /> </asp:TreeView> </ContentTemplate></asp:UpdatePanel>

Any help will be truly appreciated.

Jose

Well, I hate to answer my own posts, but I guess stepping out of the office gave me a fresh set of eyes. My problem lied in the IsPostBack property:

protected void Page_Load(object sender, EventArgs e) {if (!Page.IsPostBack) PopulateRootLevel(); PopulateRootLevel_OD(); PopulateRootLevel_RO(); }

It should be:

if (!Page.IsPostBack) { PopulateRootLevel(); PopulateRootLevel_OD(); PopulateRootLevel_RO(); }
Hope it helps someone.

treeview inside of updatepanel = Validation of viewstate MAC failed

i have some nodes added to my treeview inside of an updatepanel and it seems to give me "

Validation of viewstate MAC failed" error each tme i click a node twice.

Nothing happens on the first time i click a node

is there some tutorial or standard thing to do with a treeview in an update panel?

It sounds very strange about asp:TreeView and asp:UpdatePanel from your description.Can you post some codes here? I'd like to test it.
I tested asp:UpdatePanel working with asp:TreeView in Ajax RC 1.0 and found it worked.
Here are my testing codes for your reference.
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:TreeView ID="tv" runat="server" OnSelectedNodeChanged="tv_SelectedNodeChanged">
<Nodes>
<asp:TreeNode Text="File" Value="File"></asp:TreeNode>
<asp:TreeNode Text="Edit" Value="Edit"></asp:TreeNode>
<asp:TreeNode Text="View" Value="View"></asp:TreeNode>
</Nodes>
</asp:TreeView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress2" runat="server"
AssociatedUpdatePanelID="UpdatePanel1"
DisplayAfter="2000"
DynamicLayout="False">
<ProgressTemplate>
UpdatePanel1 is updating now!
<input type="button" id="AbortCallbackButton" value="Abort" onclick="AbortCallback()" />
</ProgressTemplate>
</asp:UpdateProgress>
<br />
This is text after the UpdatePanel and UpdateProgress controls.
<script type="text/javascript">
function AbortCallback()
{
Sys.WebForms.PageRequestManager.getInstance().abortPostBack();
}
</script>
Behind Codes:
protected void tv_SelectedNodeChanged(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(10000);
}
Wish this can help you.

TreeView with checkboxes

Hi

As you know the nativ TreeView control does not populate the check state (when the attributeShowCheckBoxes="All") to his children nodes for perfomance reason.

Is it a way with Ajax and a timer to do the thing ?

I wrote this but i got flickering on the lines redraw of the TreeView

Any help ?

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="500" />
<asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" />
</Triggers>
<ContentTemplate>
<asp:TreeView ID="TreeView1" runat="server" ShowCheckBoxes="All" ShowLines="true" OnTreeNodeCheckChanged="OnSelectPlayer">
</asp:TreeView>
<br />
<asp:Button ID="Button1" runat="server" OnClick="OnSelect" Text="Valider la sélection" Width="127px" />
</ContentTemplate>
</asp:UpdatePanel>

Thank you a lot

Hi,

Please specify <compilation debug="false"> in web.config.

In asp.net, when in debug mode, images and javascript files severed from a web resource handler won't be cached on client.

Hope this helps.