Hi !
Please help me how to binding a UltraWebMenu from DataSet with struct "ID - ParentID". Thanks !
The formatting got screwed here is better version.
private void LoadMenuItems()
{
DataSet dsMenuItems = new DataSet();
try
//this method gets you the 2 datatables in the dataset
GetMenu(ref dsMenuItems);
dsMenuItems.DataSetName = "Menu";
dsMenuItems.Tables[0].TableName = "MainMenu";
dsMenuItems.Tables[1].TableName = "SubMenu";
dsMenuItems.Relations.Add("RELATION", dsMenuItems.Tables[0].Columns["MAINMENUITEMID"],
dsMenuItems.Tables[1].Columns["MAINMENUITEMID"], true);
//populate the menu here
if (dsMenuItems != null)
UltraWebMenu1.DataSource = dsMenuItems;//.Tables[0].DefaultView;
//UltraWebMenu1.Levels[0].TargetUrlName = "NAVIGATIONURL";
UltraWebMenu1.Levels[0].ColumnName = "MAINMENUITEMNAME";
UltraWebMenu1.Levels[0].LevelKeyField = "MAINMENUITEMID";
UltraWebMenu1.Levels[0].RelationName = "RELATION";
UltraWebMenu1.Levels[1].TargetUrlName = "NAVIGATIONURL";
UltraWebMenu1.Levels[1].ColumnName = "SUBMENUITEMNAME";
UltraWebMenu1.Levels[1].LevelKeyField = "SUBMENUITEMID";
UltraWebMenu1.DataMember = dsMenuItems.Tables[0].TableName;
UltraWebMenu1.DataBind();
}
catch (Exception ex)