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
260
bind data
posted

hi , i have a problem withe binding data to a UltraWebTree, i use a datatable as datasource, but when i execute the aplicaton i can`t see the webtree, here some code:

this is the webtree:

<ignav:UltraWebTree ID="uwtAreas" runat="server" DefaultImage="" ExpandOnClick="True"

                        HoverClass="" Indentation="20" LoadOnDemand="Automatic" LoadOnDemandPrompt="<b>Cargando...</b>"

                        OnNodeClicked="uwtAreas_NodeClicked" Width="110px" AutoPostBack="True" DataMember="datos" MaxDataBindDepth="3">

                        <Levels>

                            <ignav:Level Index="0" ColumnName="NOMBREAREA" LevelKeyField="CODIGOAREA" />

                            <ignav:Level Index="1" ColumnName="NOMBRETIPO" LevelKeyField="CODIGOTIPO" />

                            <ignav:Level Index="2" />

                        </Levels>

                    </ignav:UltraWebTree>

 

this is in the code behind:

 protected void Page_Load(object sender, EventArgs e)

    {

        if (!Page.IsPostBack)

        {

            uwtAreas.DataSource = presentacion.NodosPorMostrar; (returns a datatable)

            uwtAreas.Levels[0].LevelKeyField = "CODIGOAREA";

            uwtAreas.Levels[0].ColumnName = "NOMBREAREA";

            uwtAreas.Levels[1].LevelKeyField = "CODIGOTIPO";

            uwtAreas.Levels[1].ColumnName = "NOMBRETIPO";

            uwtAreas.DataBind();

 }

Parents
  • 28407
    posted

    HI,

     If this is a parent-child relationship you are missng the RelationName at Level[0].

     Since you are using Automatic Load on demand - you must data bind on every post back.

    When the plus image is clicked to expand, UltraWebTree will post back to the server and automatically load the child nodes for the node that was clicked. In order to load the proper nodes on post-back, DataBind needs to be called for UltraWebTree each time.

Reply Children
No Data