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();
}
well is not exactly parent-child relationship i wanna see it like this, the estructure of mi datatabel is like that, 4 columns parent_code, parent_name, child_code,child_name ; and i want a tree like :
Parent
-child
etc....
so taht's why i use LevelKeyField = "CODIGOAREA"; and uwtAreas.Levels[0].ColumnName, but i cant see anything when the aplication runs, please help me
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.