Refresh a specific grid with a button

Exactly. Service says it’s a bug and it’s supposed to be fixed in 10.2. I worked in 10.0.700, then when we went to 10.1.600.5 it didn’t work.

Seems to be this should be a bigger problem, but it seems I’m one of the few that likes to build customizations on top of dashboards. I find the native epicor screens much too complicated and too tedious for the way our business is set up. We run most of our shop on home grown dashboards. Currently I am working a replacement for the work queue to be able to filter by the information that we regularly use, and not by other things that epicor wants us to use. I’m getting close to being ready to deploy, just working on cleaning up as much of the idiosyncrasies that I am capable of, (which thank God is a growing list, my capabilities that is!)

Use the Custom XML editor and find your controls in there if you dare. You could use the ParentControlKey property (= panel guid) to find on the beast that live under that panel.

You may have to do that again if you find additional hierarchy below that (other sheets, panels, groupboxes, etc)

Once you get the guid and the type, you can wrestle that bear

That only works when you’ve already customized it, like the things I already did in 10.0 and upgraded. On new dashboards, it won’t show up. I got bummed when I figured that out…

is there a child property key? That’s what I really need.

Damn, that is tough. Well I learned something new today. I thought all of the native controls were in the XML too. I wonder if one could just loop thru all the controls and list only the panels (and their GUIDs)

@Banderson I’m with you. I’ve used a deployed dashboard to create customised work reporting screen:

My latest personal win, was getting this bit to work. It’s taking the selected row of the grid, then calling BAQ Adapter to populate the lot tracked materials bit, then that row is used to find all available lots.

1 Like

If you like hacky workarounds you’ll love this. Get all the panels and their GUID of your form (be sure to change your form name)


	private void PanelCheck(Control control)
	{
	if(control == null) return;
	
		if(control.GetType().ToString().ToLower().Contains("panel"))
		{
			EpiBasePanel pn = (control as EpiBasePanel);
			string guid = "";
			if(pn != null)
			{
				guid = pn.EpiGuid;
			}
	
			var res = string.Format("{0} {1} {2}\n",control.Name,guid, control.GetType().ToString());
			controlslist += res;
		}
	}

	private void ProcessAllControls(Control rootControl, Action<Control> action)
	{
		
	    foreach (Control childControl in rootControl.Controls)
	    {
			if(childControl != null)
			{
		        ProcessAllControls(childControl, action);
		        action(childControl);
			}	
	    }
			
		
	}


	private void CustShipForm_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
		
		ProcessAllControls(CustShipForm, ctl => PanelCheck(ctl));
		if(controlslist != "")MessageBox.Show(controlslist);
	}

2 Likes

I’ll try it out tomorrow!

So that get’s me all of the panels, If I change “Panel” To “Grid” will that get me all of the grids?

p.s. getting GUIDS in a window that you can’t copy and paste from is just cruel… I may have to add a write out to text file…

You can do a Ctrl+C to copy the message box text.

Also, see this post.

1 Like

Thanks for the tip! The feedback when you do that makes it seem like it won’t copy, but lo and behold it does!

So I got it to work by changing this:

if(control.GetType().ToString().ToLower().Contains(“panel”))

to this:

if(control.GetType().ToString().ToLower().Contains(“grid”))

and this

EpiBasePanel pn = (control as EpiBasePanel);

to
EpiUltraGrid pn = (control as EpiUltraGrid);

and now I get.

myGrid 18c1507c-c20e-44b5-a163-642d05d67d8b Ice.Lib.Framework.EpiUltraGrid
CustomGrid 994a7055-2964-46f1-8488-0c2359109f4f Ice.Lib.Framework.EpiUltraGrid

yay!

As you can see from the example you linked to, I’ve been dealing with this problem since July. I was just too green at the time to understand how to get help from Jose in the coding. I’m getting better at it now, thankfully.

Well, I got the focus thing to work, however, it doesn’t do the same thing as actually clicking in the grid. So it focuses to the grid, then refreshes (the old way, everything else but that grid) and then focuses back.

grrrrrrrrr.

However, now that I can get to the provided grid, I may be able to use the provided grid instead of the custom added one, which could help alleviate the problem. I still can’t get to the GUI controls, but I think I can set up what I need in the dashboard before it’s deployed so I don’t think it will be too bad.

It’s the little things that kill you.

At this point it’s getting a little tough. First thought is you could get a ref to the click event handler of the grid in question and call it manually but that requires reflection.

Second thought is probably smarter but also requires reflection, luckily it’s all bundled up for you. Get yourself a decompiler like ILSpy, DotPeek, Reflector, etc. Open your dashboard DLL. Browse in it to find what code is being called by the click events. This will show you how they are refreshing those grids.

so I downloaded ILspy portable, and opened one of the DLL’s that it in the stored DLL’s on my computer. What would I be looking for? I can search for refresh, but, there’s a lot of them…

This one looks promising, but how would I make the work on a specific grid?

the DLL is gonna be your dashboard assembly (so it will be listed in your menu item). It will be found in your client dir.

I don’t think it’s in there. It’s stored on the server isn’t it? Then just brought down into the cache when used right?

Or did you mean in the client directory on the server?

I can’t find it on the server anywhere. On my computer I get these. Should be one them right?

image

Oh yea, sorry. You can find it in (locally):
C:\ProgramData\Epicor\urserver\UrVersion\urCompany\shared\CustomDLLs

OK, now that I have it open, how do I find anything? This is like reading a foreign language to me.

I’m looking for a method right? When I search for refresh, there are a lot of things pop up. How do I narrow it down?

Somewhere in here right? The refresh is on the MainController right?

Aren’t you glad you opened up this can of worms? haha.

easiest place to start is probably top level, find the definition of your grid - from there you can find all references to it

yeah, still don’t know what I’m looking for.

I’ll have to put this on the list of things I’ll learn at a later date probably.

This is friggin brilliant.