hi all
I have a code in which works well in web application
private void AddTopMenuItems(DataTable menuData)
{
DataView view = new DataView(menuData);
view.RowFilter = "ParentId IS NULL";
foreach (DataRowView row in view)
{
MenuItem newMenuItem = new MenuItem(row["Name_tb"].ToString(), row["CategoryId"].ToString());
Menu1.Items.Add(newMenuItem);
AddChildMenuItems(menuData, newMenuItem);
}
}
but when using this code in windows based application error arising in lines
MenuItem newMenuItem = new MenuItem(row["Name_tb"].ToString(), row["CategoryId"].ToString());
and
menuStrip1.Items.Add(newMenuItem);
errors messages are
The best overloaded method match for 'System.Windows.Forms.MenuItem.MenuItem(string, System.EventHandler)' has some invalid arguments
and
The best overloaded method match for'System.Windows.Forms.ToolStripItemCollection.Add(System.Windows.Forms.ToolStripItem)' has some invalid arguments
how to do this web application code in windows