Hi I am trying to find all mdi menu items and menu items child and there child. in mdi there is three level for menu.
now problem is I am able to find child upto second level, please help me to find the third level child. for example: Master->Station->domestic , I am able to search till station not domestic below is the code.
public void SecurityCheck(MDIColts ObjMdi)
{
Int32 Count;
if (Global.GetInstance.LoggedInUserType != "SA")
{
foreach (ToolStripMenuItem tsmi in menuStrip.Items)
{
if (colMenuItem.Contains(tsmi.Name) == true)
{
tsmi.Visible = true;
}
else
{
tsmi.Visible = false;
}
for (Count = 0; Count < tsmi.DropDownItems.Count; Count++)
{
if (colMenuItem.Contains(tsmi.DropDownItems[Count].Name) == true)
{
tsmi.DropDownItems[Count].Visible = true;
}
else
{
tsmi.DropDownItems[Count].Visible = false;
}
}
}
else
{
foreach (ToolStripMenuItem tsmi in menuStrip.Items)
{
tsmi.Visible = true;
for (Count = 0; Count < tsmi.DropDownItems.Count; Count++)
{
tsmi.DropDownItems[Count].Visible = true;
}
}
}
}