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
145
Tree is gone after nodeclick
posted

Hi all,

I'm quite new to Infragistics.

Could you pls help my issue below.

I have Infragistics tree created, however when i add event for Node clicked or Selection changed, whenever I clicked on the tree node itself, the tree will disappear.

However whenever i removed the code behind event for node clicked or selection changed, whenever i clicked on the node, the tree did not disappear.

How to add event for node clicked, without making the tree disappear?

Here's my aspx code

<ignav:UltraWebTree id="AITree" runat="server" Width="400px" Height="400px" LoadOnDemand="ManualSmartCallbacks"
        Font-Names="Verdana" Font-Size="8pt" EnableViewState="False" CompactRendering="False" ExpandImage="images/ig_treeXPPlus.gif"
        CollapseImage="images/ig_treeXPMinus.gif" WebTreeTarget="ClassicTree" ForeColor="Black" BorderColor="Pink"
        BorderStyle="None" Indentation="20" Cursor="Default" BackImageUrl="" DefaultImage="" DefaultIslandClass="" DefaultItemClass="" DefaultSelectedImage="" DisabledClass="" FileUrl="" HiliteClass="" HoverClass="" JavaScriptFilename="" JavaScriptFileNameCommon="" LeafNodeImageUrl="" NodeEditClass="" ParentNodeImageUrl="" RootNodeImageUrl="" TargetFrame="" TargetUrl="" ExpandOnClick="True" AllowDrag="True" AllowDrop="True">
        <SelectedNodeStyle Cursor="Hand" ForeColor="White" BackColor="DarkBlue" CssClass="SelectClass"></SelectedNodeStyle>
        <HoverNodeStyle Cursor="Hand" CssClass="Hover"></HoverNodeStyle>
        <NodePaddings Left="5px"></NodePaddings>
        <Padding Top="10px"></Padding>
        <Levels>
            <ignav:Level Index="0" CheckboxColumnName="" ColumnName="" ImageColumnName="" LevelClass="" LevelHiliteClass="" LevelHoverClass="" LevelImage="" LevelIslandClass="" LevelKeyField="" RelationName="" TargetFrameName="" TargetUrlName=""></ignav:Level>
            <ignav:Level Index="1" CheckboxColumnName="" ColumnName="" ImageColumnName="" LevelClass="" LevelHiliteClass="" LevelHoverClass="" LevelImage="" LevelIslandClass="" LevelKeyField="" RelationName="" TargetFrameName="" TargetUrlName=""></ignav:Level>
        </Levels>
        <NodeMargins Top="2px"></NodeMargins>
        <Styles>
            <ignav:Style BackColor="OldLace" CssClass="HiliteClass" Cursor="Hand" ForeColor="Black">
            </ignav:Style>
            <ignav:Style BackColor="Gainsboro" BorderColor="DarkGray" BorderStyle="Solid" BorderWidth="1px"
                CssClass="Hover">
                <Padding Bottom="2px" Left="2px" Right="2px" Top="2px" />
            </ignav:Style>
            <ignav:Style BackColor="#333333" CssClass="SelectClass" ForeColor="White">
                <Padding Bottom="2px" Left="2px" Right="2px" Top="2px" />
            </ignav:Style>
        </Styles>
        <ClientSideEvents />
    </ignav:UltraWebTree>

My code behind

Protected Sub AITree_NodeSelectionChanged(ByVal sender As System.Object, ByVal e As Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs) Handles AITree.NodeSelectionChanged
            Response.Write("test")
    End Sub

Another question:

How can we call .NET code from the javascript client-side??

Thanks!

Parents
  • 558
    posted

    Hi Sistasi,

    The reason why your tree is disappearing after a postback is because EnabledViewState is set to false.

    ASP.NET maintains a page level information using ViewState on each postback, regardless if that postback is caused by another control on the page or by the tree itself. So when ViewState is set to false you have to re-bind the control once again, because no information about the control is maintained between postbacks.

    Please test your code after making following change:
    UltraWebTree.EnabledViewState = true.

    After making this change you will see that tree will not disappear because its state is stored in the ViewState.

    Please let me know if you have any questions with this matter.

    Sincerely,
    Neha

Reply Children