Disable AxToolbar when the grid is empty
By adding this code to the page it's possible to disable or hide the AxToolbar and add logic on menu items.
Read more here
void Page_Init(object sender, EventArgs e)
{
// Setup event handler for toolbar connected via webpart connections
if (this.NameofAxToolbar != null)
this.NameofAxToolbar.SetMenuItemProperties +=
new EventHandler(webpart_SetToolbarMenuItemProperties);
}
protected void webpart_SetToolbarMenuItemProperties(object sender, SetMenuItemPropertiesEventArgs e)
{ if(EPProjTableList.GetDataSourceView(this.EPProjTableListGrid.DataMember).DataSetView.Count < 1)
{
e.MenuItem.Disabled= true;
}
}
Read more here
Hi
ReplyDeleteI thy this solution, bud didnot work property Disabled. Property Hidden work well.
Any solution
Frank