Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
NodeClick gets fired more than once?
posted

Hi All,

 

I have a WebDataTree which I populate in the page_load on the server-side, all works well, but I am getting a problem where the NodeClick event seems to get fired multiple times.

The tree is defined as follows

 

 

<ig:WebDataTree ID="wdtCase" runat="server" Height="300px" Width="100%" 

    EnableConnectorLines="True" onnodeclick="wdtCase_NodeClick" 

    onselectionchanged="wdtCase_SelectionChanged">

    <AutoPostBackFlags NodeClick="On" SelectionChanged="Async" />

    <ClientEvents Initialize="InitializeHandler" NodeClick="NodeClickHandler" NodeCollapsed="NodeCollapsedHandler"

                    NodeCollapsing="NodeCollapsingHandler" NodeExpanded="NodeExpandedHandler" NodeExpanding="NodeExpandingHandler"

                    NodeHovered="NodeHoveredHandler" NodeUnhovered="NodeUnhoveredHandler" NodePopulated="NodePopulatedHandler"

                    NodePopulating="NodePopulatingHandler" CheckBoxSelectionChanged="NodeCheckBoxSelectionChangedHandler"

                    ActivationChanged="NodeActivationChangedHandler" ActivationChanging="NodeActivationChangingHandler"

                    SelectionChanged="NodeSelectionChangingHandler" SelectionChanging="NodeSelectionChangingHandler" />

 

    <AjaxIndicator AltText="Async post" />

</ig:WebDataTree>

 

 

Nothing out of place there, then the NodeClick event is

 

 

 protected void wdtCase_NodeClick(object sender, Infragistics.Web.UI.NavigationControls.DataTreeNodeClickEventArgs e)

        {

            // Raise the NodeClick event out.

            if(this.NodeClicked != null) 

            {

                // do stuff here

            }

        }

 

 

But the event is called multiple times, not just once. Has anyone got any suggestions?

 

Many thanks

Parents
No Data
Reply
  • 3726
    posted

    Hi,

    you should not use Auto postback flags for NodeClick and SelectionChanged in the same time, because it will only fire selection changed first and then do an async postback. Also in the event handler you should use e.Node instead of this.NodeClicked. Are you sure the event is not fired for different nodes?

Children