Dashboard - multi-line column headers?

Has anyone successfully customized a dashboard to have multi-line column headers? I followed this thread and tried piecing some code together that a user stated worked for them.

The code compiles successfully, but the result is seemingly no change at all on the Dashboard. The columns behave exactly as before (dragging the width narrower does not “line-break” the text.) Is that not what I should’ve expected to happen? Should I be adding some kind of line break character in the column name text?

Here is what I attempted:

	public void InitializeCustomCode()
	{
		var yourGridRef = (EpiUltraGrid)csm.GetNativeControlReference("0449b82e-466e-4480-a96f-2940db53b5d3");
		yourGridRef.InitializeLayout += (o,e) =>
			{
  			var sender = (EpiUltraGrid)o;
  			sender.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;```

EDIT: Move your display code to the Form Load event. I don’t believe it will work in the Initialize Custom Code. As some extra, you can also set the default row height and make your data rows also wrap text. I included that below. It will look like this.
image

	private void MainController_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
		//allTasks.DisplayLayout.Override.DefaultRowHeight = 50;
		allTasks.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
		allTasks.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
		allTasks.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
	}
4 Likes

Thank you so much for the help. I think I’ve got it structured correctly now, with the display code moved to the Form Load event, along with your other lines (which I’ve commented out for testing the header).

This is still having no effect at all on the column headers:

	private void MainController_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
		
		var EndOfWeekGrid = (EpiUltraGrid)csm.GetNativeControlReference("0449b82e-466e-4480-a96f-2940db53b5d3");
		EndOfWeekGrid.InitializeLayout += (o,e) =>
			{
  			var allTasks = (EpiUltraGrid)o;
			  //allTasks.DisplayLayout.Override.DefaultRowHeight = 50;
  			allTasks.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
			};
      }

This Dashboard has multiple grids, which I have added as their own entries in the Form Load event with their associated GUIDs. I didn’t include the full code above for simplicity’s sake, but here is the full Form Load event as I have it:

private void MainController_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
		
		var EndOfWeekGrid = (EpiUltraGrid)csm.GetNativeControlReference("0449b82e-466e-4480-a96f-2940db53b5d3");
		EndOfWeekGrid.InitializeLayout += (o,e) =>
			{
  			var allTasks = (EpiUltraGrid)o;
			  //allTasks.DisplayLayout.Override.DefaultRowHeight = 50;
  			allTasks.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
			};

		var EndOfMonthGrid = (EpiUltraGrid)csm.GetNativeControlReference("d919bfaa-ebf2-4f23-b2b0-e5d1313473ef");
		EndOfMonthGrid.InitializeLayout += (o,e) =>
			{
  			var allTasks = (EpiUltraGrid)o;
			  //allTasks.DisplayLayout.Override.DefaultRowHeight = 50;
  			allTasks.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
			};

		var BeyondGrid = (EpiUltraGrid)csm.GetNativeControlReference("f7e7cb58-a93c-484e-814a-ad6e990ce0be");
		BeyondGrid.InitializeLayout += (o,e) =>
			{
  			var allTasks = (EpiUltraGrid)o;
			  //allTasks.DisplayLayout.Override.DefaultRowHeight = 50;
  			allTasks.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
			};

		var OrderIssuesGrid = (EpiUltraGrid)csm.GetNativeControlReference("b62bb6b3-e249-4c78-a34d-4ba4fb30e2bc");
		OrderIssuesGrid.InitializeLayout += (o,e) =>
			{
  			var allTasks = (EpiUltraGrid)o;
			  //allTasks.DisplayLayout.Override.DefaultRowHeight = 50;
  			allTasks.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
			};

		var LateOrdersGrid = (EpiUltraGrid)csm.GetNativeControlReference("e22b6a61-8d24-48fa-a99d-f2fd543c202c");
		LateOrdersGrid.InitializeLayout += (o,e) =>
			{
  			var allTasks = (EpiUltraGrid)o;
			  //allTasks.DisplayLayout.Override.DefaultRowHeight = 50;
  			allTasks.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
			};

		var AllOrdersGrid = (EpiUltraGrid)csm.GetNativeControlReference("e11cefa8-034a-4cbf-b51b-4f92a571e4ec");
		AllOrdersGrid.InitializeLayout += (o,e) =>
			{
  			var allTasks = (EpiUltraGrid)o;
			  //allTasks.DisplayLayout.Override.DefaultRowHeight = 50;
  			allTasks.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
			  //allTasks.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
			};
		
	}

Is there anything else I’m supposed to do outside of the customization to get the desired effect? I’ve tried Redeploying, clearing client cache, reloading Epicor.

You’re triggering that off of InitializeLayout.

That’s already run most likely at that point.
Just do it on the grid directly.

1 Like

Yes, thank you! This was the last piece. For anyone else looking, here is what my final code looked like:

	private void MainController_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
		
		var EndOfWeekGrid = (EpiUltraGrid)csm.GetNativeControlReference("0449b82e-466e-4480-a96f-2940db53b5d3");
			{
			  //EndOfWeekGrid.DisplayLayout.Override.DefaultRowHeight = 50;
  			  EndOfWeekGrid.DisplayLayout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
			  EndOfWeekGrid.DisplayLayout.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;
			  EndOfWeekGrid.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.AutoFree;
			};
     }
1 Like