AddMenuItems(dbMenuItem.GetChildRows(dr), dr, csMenuGroup);
}
}
}
//=============================================================================
// AddMenuItems - Recursive function to populate hierarchical Menu Items
// from data rows that have parent/child relationships.
//
// input:
// dataRows - [in] Child Rows
// dataRel - [in] Data Relation
// webMenuGroup - [in] WebMenu Group
//
// output:
// none
//
public void AddMenuItems(DataRow[] dataRows, DataRelation dataRel, Coalesys.WebMenu.Group webMenuGroup)
{
Coalesys.WebMenu.Item csMenuItem;
Coalesys.WebMenu.Group csNestedMenuGroup;
DataRow[] drChildren;
foreach(DataRow dbMenuItem in dataRows)
{
csMenuItem = webMenuGroup.Items.Add();
csMenuItem.Caption = dbMenuItem["Caption"].ToString();
csMenuItem.URL = dbMenuItem["URL"].ToString();
if (dbMenuItem["Enable"].ToString()=="True" )
{
csMenuItem.Enabled=true;
}
else
{
csMenuItem.Enabled=false;
}
// check if this Item has children of it''''s own
drChildren = dbMenuItem.GetChildRows(dataRel);
// if so, create a group for the children and reenter this function.
if(drChildren.Length > 0)
{
上一页 [1] [2] [3] [4] 下一页 [C语言系列]NET 中C#的switch语句的语法 [系统软件]托拽Explore中的文件到VB.net的窗口 [系统软件]Boost库在XP+Visual C++.net中的安装 [常用软件]新配色面板:Paint.Net3.0RC1官方下载 [常用软件]用内建的“Net Meeting”聊天 [VB.NET程序]Henry的VB.NET之旅(三)—共享成员 [VB.NET程序]Henry的VB.NET之旅(二)—构造与析构 [VB.NET程序]Henry的VB.NET之旅(一)—失踪的窗体 [VB.NET程序]在托盘上显示Balloon Tooltip(VB.NET) [VB.NET程序]Henry手记-VB.NET中动态加载Treeview节点(二)
|