The UD Form actually comes with the regular Print Tool, it doesnt do anything but you can make it visible and then use it.
// Enable the Print Tool
baseToolbarsManager.Tools["PrintTool"].SharedProps.Enabled = true;
baseToolbarsManager.Tools["PrintTool"].SharedProps.Visible = true;
Then just use the event
private void UD100Form_BeforeToolClick(object sender, Ice.Lib.Framework.BeforeToolClickEventArgs args)
{
switch (args.Tool.Key)
{
case "PrintTool":
if (edvUD100A.dataView.Count == 0) {
args.Handled = true;
}
break;
}
}
Thats another option. I do appreciate @surendrapal solution. Good timing as I just needed to add a new button to the Standard Tools