Any way to get grid format options to stick?

I’m trying to make the font size a little bigger and bold to be easier for people to read in a grid. I can change the property in the customization, and it changes upon saving. However, when re-loading the customization, they go back to the way that they were. Is there a trick to getting them to actually stay? Or do I have to set them manually in code on form load?

Unless you use C# to hard code those changes or are able to make your changes in a personalization and incorporate them into your customization you’re boned. Making those sort of changes in a customization (aside from hidding and showing columns) just doesn’t work reliably.

Bummer, guess I have to learn some more C# today. Any good links for style control? I’ve found some with google, and I’ve tried looking through the object explorer, but it’s kind of hard to find stuff if you don’t know exactly what you’re looking for.

You’ll have to parse through Infragistics website for the ultra grid control. It’s a matter of just poking through it, testing, and retesting it’s all part of the learning process. Start with a literal search in google that’s the best way to go!

So I figured out how to set column widths, but I cannot for the life of me figure out how to set the anchoring for the bottom and right. When I google it, it usually pops up “Use the property screen” which doesn’t work in epicor. I tried Adding

this.MainGrid.Anchor = (System.Windows.Forms.AnchorStyles.Top …),

for each of the sides, and it seems to anchor them now, however, the distance from the edge is too large. I think it has to do with padding right? Or do I have to get the window size as a variable so I can do the math in the customization to set the grid size correctly? Any hints would be appreciated.

Regarding the formatting, have you tried turning off UseAppStyling?

Regarding anchors, they are relative to the size of the screen when you set them. So if you adjust the grid to match your form (or however you want it) manually, resizing should then affect your grid proper (assuming you’ve anchored all sides)

Ok, so I was able to get the size of the form to stick using the properties, and I inserted

	this.MainGrid.Width = 1150;

To get the grid size to match up. So I think I am good there.

I turned it off once. I looks really crappy so I turned it back on. What else would that do for me?

Anyways, now I am setting up row rules. This is the line that it adds to set the style. I’m trying to figure out if I can simply set a row background color instead of a style, since the styles available are a limited list.

RuleAction okV_PackOrNotUpdate2_1View_RowAction = RuleAction.AddRowSettings(this.oTrans, "V_PackOrNotUpdate2_1View", true, SettingStyle.OK);

Where it says “SettingStyle.ok” can I replace it with something like is suggested on this page, like Color.Red? That doesn’t work, but I can’t imagine it can be that hard can it?

Oh, intellitype or whatever it’s called would be super helpful!!!

ControlSettings myControlSettings = new ControlSettings();
myControlSettings.BackColor = System.Drawing.Color.MediumSeaGreen;

RuleAction warningV_JobDashboard_1View1_RowAction = RuleAction.AddRowSettings(this.oTrans, “V_JobDashboard_1View1”, false, myControlSettings);

This works for me.

@markdamen Thank you so much! That works great.

I even found a nice list of colors to use.

http://www.flounder.com/csharp_color_table.htm

Do you just ignore the error that comes up about the length when you open up the customization editor? I’m assuming it has to do with the rule actions not matching the autogenerated code any more.

image

Yep just been ignoring those. I get 8 pop up for all different row rules!!

If you can solve that, amazing!!

Good to know.

Do you know what the True or False does in (this.oTrans, “V_JobDashboard_1View1”, false, myControlSettings);? It’s set to true on the autogenerated row rules, and I’ve tried both and don’t see a difference.

It sets the GridOnly property. I guess that tells it that it isnt running the rule on underlying dataview? Not sure

That makes sense. How can I look up what that something like that is? I’m trying to be more self reliant and being able to find what I need, but,I tried googling a bunch of stuff, parsed through the infragistics website, looked through the object explorer and could not find out anything relating to that snippet of code. There has to be better ways then “ask someone on the internet”. I’m spoiled with this group being willing to answer questions, but that only works for most things, not everything!

Use a tool like ILSpy or DNSpy to decompile the appropriate DLLs in the client folder

I hate to bring this up again, but I am trying to get a grid size to stick, and even setting it using C# one of my 3 grids will not stick. I am trying to set the grid size to 1100 by 550, but every time, is loads 1171 by 575

Here’s the code to set the properties. But for some reason, the StartActivityGrid will not come is at the correct size. Am I doing something wrong? The other 2 seems to be working, but I don’t know if it’s just by dumb luck or what.

//this section is for formatting everying on all screens
	private void MainController_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code

		//this is for setting the size of the grids
		this.StartActivityGrid.Width = 1100;
		this.StartActivityGrid.Height = 550;
		this.EndActivityGrid.Width = 1100;
		this.EndActivityGrid.Height = 550;
		this.PaintLabelGrid.Width = 1100;
		this.PaintLabelGrid.Height = 550;
		//this if for anchoring the grids
		this.StartActivityGrid.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom);
		this.EndActivityGrid.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom);
		this.PaintLabelGrid.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom);		

		

	}

ok. so I figured out an interesting hack. Apparently the system won’t change the grid that’s in focus. So, I added these lines around it to focus on something else, then set the properties, then focus back.

	EndActivityGrid.Focus();
	this.StartActivityGrid.Width = 1100;
	this.StartActivityGrid.Height = 550;
	StartActivityGrid.Focus();

Kind of like saying “Hey what’s that!” to the computer, then changing something before it looks back.

dumb…

edit:
Never mind, it’s not working like that. Something else that I am doing is making it stick. But I don’t know what… Now I’m having problems on the other grids…

1 Like

That was a wild ride. Did you ever get this working?

Yeah. It’s a pretty neat solution. When a job is built or modified I have a baq looks for anything that needs to be added/changed/deleted from UD08. We then use DMT to adjust what needs adjusting (I should make a service connect workflow or powershell script or something to automate this better, but I haven’t been motivated enough to tackle that). After that, they can use this dashboard to denote whether or not the assemblers should assemble the parts or pack them loose. This merges with data from an app that we had built that checks what they have on the packing lists and what this dashboard says and tells them if there is anything that doesn’t match up. It works pretty good when everyone does what they are supposed to.