I’m trying to see if I can call a refresh from code. When I click on the screen one, it clears a partially entered form, which is what I want. I tried oTrans.Refresh() and it doesn’t clear.
I’m trying to see if I can use this, but it won’t compile, it says that AppControlPanel is not in the definition for UD10Form. Does anyone know how to call the refresh from the tool bar on a UD form?
UD10Form.AppControlPanel.HandleToolClick("RefreshTool", new
Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(UD10Form.MainToolManager.Tools["RefreshTool"], null));
I did not. The form worked well enough to do what we needed it to do, but not as well as I would have liked. Luckily for us, it will just be used for physical inventory, and only by certain trainable people, so we just lived with it.
That’s the same as what I have at the beginning of the the thread. There is no MainController in the UD entry screen, so that’s why it’s UD10Form. But it doesn’t work.
//add using System.Reflection;
MethodInfo mi = typeof(EpiBaseForm).GetMethod("handleToolClick", BindingFlags.Instance | BindingFlags.NonPublic);
mi.Invoke(UD10Form, new object[]{"PrintClientTool",new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(UD10Form.MainToolManager.Tools["RefreshTool"],null)});
I don’t need it anymore. @knash was the one who was asking. He contacted me offline and said he got it working. I’ll revisit someday when I want to learn something new.
Thanks for this discussion. I followed it as closely as I could but couldn’t get it to work. These are the errors I got. Do you have any idea what I might have done wrong?
Error: CS0708 - line 29 (77) - ‘Script.RefreshButton’: cannot declare instance members in a static class
Error: CS0708 - line 60 (108) - ‘Refresh_Click’: cannot declare instance members in a static class