Dashboard Text wrapping / Row Height


(Evan Purdy) #1

How can I make the rows in a dashboard tall enough to fit all the text in a field (part description)?


(Evan Purdy) #2

So I would guess that the table on a dashboard is an EpiUltraGrid, based off a Infragistics UltraGrid if I understand correctly… So if I could set DisplayLayout.Override.CellMultiLine = DefaultableBoolean.True and DisplayLayout.Bands(0).Override.RowSizing = RowSizing.AutoFree then I would probably get the result I want.

Is there any way to customize a dashboard?


(Chris Conn) #3

Sure, compile it to an assembly (SmartClient), add a menu item for it, create a customization for it.


(Evan Purdy) #4

How though? When I click any other menu item, such as quote entry the customization window appears but when I click dashboard menu items it does not show that window.


(Chris Conn) #5

I’m confused as to what you just said. Is it that you not know how to compile to an assembly? Or how to add it to the menu? Or add a customization?


(Evan Purdy) #6

I have a dashboard. I have deployed it with the “Deploy Smart Client Application” Checked
I have a menu item for this dashboard.
With developer mode turned on, clicking on the menu item does not present any of the customization options I would expect to see. If I customize the quote entry form or other menu items I can add controls, code etc. I can only change which fields show and what grouping is used for the Dashboard, not add controls such as buttons etc.


(Chris Conn) #7

Did you create the menu item or was it autocreated? If so - did you select Dashboard Assembly (not runtime)


(Evan Purdy) #8

I don’t have menu security access - got my boss to change it and now it works. (After restarting Epicor) Thanks.

Now I just need to get the text to wrap.


(Evan Purdy) #9

The text wraps fine but the rows are not getting taller to fit the text. This is what I have:

Ice.Lib.Customization.PersonalizeCustomizeManager personalizeCustomizeManager = this.csm.PersonalizeCustomizeManager;

		// myGrid
		Ice.Lib.Framework.EpiUltraGrid local5 = ((Ice.Lib.Framework.EpiUltraGrid)(personalizeCustomizeManager.ControlsHT["a054b6e7-16d8-4237-9e56-89afe9b20333"]));
		local5.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
		local5.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
		// myGrid
		Ice.Lib.Framework.EpiUltraGrid local6 = ((Ice.Lib.Framework.EpiUltraGrid)(personalizeCustomizeManager.ControlsHT["6c520fd9-6bb7-4ecb-a97c-63503cc23b58"]));
		local6.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
		local6.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;

			foreach ( Infragistics.Win.UltraWinGrid.UltraGridRow row in local6.Rows.All)
            {
                row.PerformAutoSize();
            }
			foreach ( Infragistics.Win.UltraWinGrid.UltraGridRow row in local5.Rows.All)
            {
                row.PerformAutoSize();
            }
		MessageBox.Show("Ran");

How do I get the rows to auto-size to be tall enough for the text to fit?


(Chris Conn) #10

Maybe try

UltraGrid.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;


(Evan Purdy) #11

Hmm, maybe I am confused but isn’t that in the code I posted :thinking:

(Edited out the "not working comments as I don’t actually know what part isn’t working in the code)


(Chris Conn) #12

Lol - I only read 30% of any given posts in no particular order apparently :stuck_out_tongue:

So what function/event is triggering your code?


(Evan Purdy) #13

I have it in InitializeCustomCode()


(Chris Conn) #14

Perhaps you could add an event to the grid for InitializeLayout. Not sure, I’d have to play with it.

A possibility is that some underlying code it setting the formatting of that grid.You could easily test that theory by adding a grid as a custom control and seeing if it behaves any differently.


(Evan Purdy) #15

I think something related to grouping might be screwing it up? I notice that when things are un-grouped I can resize each row individually but when things are grouped resizing one row resizes them all…


(Evan Purdy) #16

Yeah, I added a button and put the code in the click event. It does what I want.

How would I go about making it so that my code runs after the data loads? I tried Form load and InitializeLayout for the grid but neither had the desired result.


(Chris Conn) #17

Perhaps try an InitializeLayout event. Put this in your Initialize code (change the ref as needed)

yourGridRef.InitializeLayout += (o,e) =>
{
  var sender = (EpiUltraGrid)o;
  sender.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
  //etc, rest of code here
};

(Evan Purdy) #18

That worked! - must be I set up the InitializeLayout event wrong the first time or didn’t reload the customization correctly. (Unless using an inline function makes a difference…?)

Big thanks :slight_smile:


(Chris Conn) #19

The inline wouldnt matter so much as having to explicitly create the event since you cant use the wizard on a native control. Glad it worked!


(Toby Lai) #20

Hi all,

I have followed all the steps described, but the event for initializeLayout just won’t trigger. I tried both inline function and separate function.

I think this person in this post also had the same problem.

Here is my code, the MessageBox for Event Triggered just won’t fire. Any ideas?

public void InitializeCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
	// Begin Wizard Added Variable Initialization

	dayLoadGrid = (EpiUltraGrid) csm.GetNativeControlReference("236c8dfb-5f01-4403-b73e-d104d2eb92c9");
	dayLoadGrid.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
	dayLoadGrid.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;

	foreach ( Infragistics.Win.UltraWinGrid.UltraGridRow row in dayLoadGrid.Rows.All)
    {
    	row.PerformAutoSize();
    }

	dayLoadGrid.InitializeLayout += (o,e) =>
	{
		MessageBox.Show("Event triggered");
	    var sender = (EpiUltraGrid)o;
	    sender.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
	    //etc, rest of code here
	};
	// dayLoadGrid.InitializeLayout += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.dayLoadGrid_InitializeLayout);
	// End Wizard Added Variable Initialization

	// Begin Wizard Added Custom Method Calls

	// End Wizard Added Custom Method Calls

	MessageBox.Show("InitializeCustomCode");
}