Hello,
you can use dhtmlxTreeMultitableConnector, it allows to use different tables for levels of the tree.
The code may be like following:[code] public override IdhtmlxConnector CreateConnector(HttpContext context)
{
var connector = new dhtmlxTreeMultitableConnector(
dhtmlxDatabaseAdapterType.SqlServer2005,
ConfigurationManager.ConnectionStrings[“SamplesDatabase”].ConnectionString
);
connector.MaxLevel = 2;
int level = connector.GetLevel(context.Request);
switch (level)
{
case 0:
connector.RenderQuery("country", "country_id", "", "country_name");
break;
case 1:
connector.RenderQuery("state", "state_id", "country_id", "state_name");
break;
case 2:
connector.RenderQuery("city", "city_id", "state_id", "city_name");
break;
}
return connector;
}[/code]connector.RenderQuery takes 4 parameters - table name(it can also take sql query), primari key column, foreign key, dispayed text,
Many thanks for your reply. I have managed to solve it by constucting a XML string from my ASP.NET generic handler. I will keep ypur sample code for my futrue reference.
Chen Wei
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan