Align Dashboard Summary Columns

In this dashboard, we want the values in Room_Number_c column of the summary to be center aligned so it doesn’t get confusing with the Rel column values next to it. Is there a way to do this?

@Banderson DynamicQuery Adapter - Grid Format - #4 by Chris_Conn

I saw this post of yours where you pointed to infragistics. Could you tell me where in the dashboard I need to go and add this piece of code to get the alignment to work?

Create a customization for your dashboard. In your Customization Script Editor go to (or add):

private void MainController_Load(object sender, EventArgs args)
{
   EpiUltraGrid grid = (EpiUltraGrid)csm.GetNativeControlReference("b3e2940f-c81e-4838-9d16-90eff26f2e04");  //put the guid of your grid control here!
   grid.Layout.Bands[0].Columns[5].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Center;
}

You can also substitute the index of your column with the column name in quotes. Something like:

grid.Layout.Bands[0].Columns["Room_number_c"].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Center;
3 Likes

So this would have to happen once the dashboard is deployed and put on a menu item? It can’t be done during the dashboard maintenance process?

Right. You have to deploy the dash, then customize it.

1 Like

If I wanted multiple columns to have the alignment done, would I just add another line of grid.Layout.Bands code below the “Room_number_c” line in the same method?

Also, is there no property setting within dashboard maintenance to make that change before it gets deployed?

Yes, change the column index, or name as needed. You can use .Center .Right and .Left.

On second thought, the _Load event might not be the right place for it.
Try this code:

	private void edvV_UD_OpenJobInventory_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
   EpiUltraGrid grid = (EpiUltraGrid)csm.GetNativeControlReference("203de03c-9f40-43b6-ac29-5c42da5a114b");  //put the guid of your grid control here!
   grid.DisplayLayout.Bands[0].Columns["UD09_Key4"].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Center;		
	}

Note: The name of this function should be changed to match your epiview. You can find it by clicking on your grid in customize mode and looking at the properties > EpiBinding. In my case, for the code above the EpiBinding was “V_UD_OpenJobInventory_1View”. Just replace that part with the name of your view.

You can add as many fields to this as you want.

There is no way to do this in dashboard maintenance (that I know of). It has to be a customization.

1 Like

The right way to do this is to add the event through Wizards > Form Event Wizard. Then choose EpiViewnotification, and choose your view. Add that to your code with the button on the bottom right. Now go to that new bit of code and adjust it to add the lines from above.

If you just copy/paste my code it, you will get errors as the system didn’t create the event.

1 Like

Where below should the line of code for alignment be added? When I add the view, this is what it looks like:

private void edvV_WP_OrderRelease_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
		// ** Argument Properties and Uses **
		// view.dataView[args.Row]["FieldName"]
		// args.Row, args.Column, args.Sender, args.NotifyType
		// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
		if ((args.NotifyType == EpiTransaction.NotifyType.AddRow))
		{
			if ((args.Row > -1))
			{
			}
		}
	}

Yeah, the wizard does a lot of stuff there you can get rid of. Clear out the event to look like this:

private void edvV_WP_OrderRelease_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{

}

Then inside put the code like this:

private void edvV_WP_OrderRelease_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
   EpiUltraGrid grid = (EpiUltraGrid)csm.GetNativeControlReference("203de03c-9f40-43b6-ac29-5c42da5a114b");  //put the guid of your grid control here!
   grid.DisplayLayout.Bands[0].Columns["UD09_Key4"].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Center;	
}

You still have to enter your guid and column name, but this should do it! :slight_smile:

1 Like

Where do I find the guid?

In Customization Mode, click on your grid and look at the properties and grab the EpiGuid:

1 Like

Adding all of that did not change the alignment of the column

Sorry. That all should do it. It works on my end. If you want more help, you are going to have to share some of what it looks like on your end, a la the screenshots that I have shared.

Should adding that view update the rest of the methods as well with it? Or do I need to delete the lines in destroycustomcode, initializecustomcode?

This all looks good. Just put your GUID in double quotes.

Fixed that, still no change

Does the column name need to be the field name or the description?

Do you get any compile errors? Press F5 in your code screen to see.