Set Font Property for a Specific Row in Dashboard BAQ View

Hello everyone,
I have a customized dashboard that displays a couple of custom BAQs. In these BAQs I group the results by part number, and collapse the groups so that the only open one is the top part number.

To help make things a bit more clear, I would like to change the font for any open group to bold. Barring that, I would like to set the top part number in the view to be bold.

I see that I can change the font properties for the grid item, but it changes the font for the entire grid. I started looking through the object explorer methods and properties for EpiDataView, but I didn’t find anything obviously helpful.

Is there a way to change the font for a single row in a grid?

Thanks for your time!
Nate

Here’s some bits of code that gets the active row to bold.

using Infragistics.Win.UltraWinGrid;
EpiUltraGrid mesGrid;
mesGrid = (EpiUltraGrid)csm.GetNativeControlReference(“a9cf2b4f-03f2-499e-9744-c311af7f8172”);
UltraGridRow ultraGridRow = mesGrid.ActiveRow;
ultraGridRow.Appearance.FontData.Bold = DefaultableBoolean.True;

Alot of the Epi stuff is based on and compatible with the infrigistics library, which has much better documentation than the Epi stuff. Here’s their documentation on the UltraGridRow. Documentation Archives | Infragistics

1 Like

Yes! Thank you! I think this is close to what I need! I was hunting around in infragistics, but couldn’t find this.

This code sets the row of data to bold. Is there a way to set the grouping to bold? I grouped on part number, so I would like the part number to be bold, and the row to be normal.
Thanks!
Nate

I gotcha, there should be a way but I don’t know it off the top of my head. I would go up one level of inheritance and try to find a class that has a name that sounds like it would work haha.

So looking through the UltraWinGrid classes (parent to UltraGridRow), I see an UltraGridSummaryRow class that may do the trick. That sure does sounds like what you are referring to, could be worth a shot.

That may be the one at the bottom now that I think about it (Where your Avg, Sum, Min, Max values go)

I missed UltraGridGroupByRow, this may be the class you’re after. This has that same apparance/FontData class tied to it too.

I found the same thing but I can’t quite figure out the syntax. This is what I have but it doesn’t compile:

	void BoldTopLine()
	{
		mesGrid = (EpiUltraGrid)csm.GetNativeControlReference("724d4f74-671e-4121-a733-bc073bdb144d");
		mesGrid.UltraGridGroupByRow.Appearance.FontData.Bold = DefaultableBoolean.True;
	}

Do you want all your row groups or just the one to be bold? Maybe the UltraGridGroupByRow is meant to reference a single GroupByRow. For the UltraGridRow, I think it has to be set to a certain row. Maybe the same goes for the UltraGridGroupByRow.

Capture42
I want to bold just the part number for any open group. (Or for just the top group if it’s easier).

I found some documentation that helps do one row.

Was able to get a bold groupbyrow and an unhandled exception with

UltraGridGroupByRow groupByRow = (UltraGridGroupByRow)mesGrid.Rows[0];
groupByRow.Appearance.FontData.Bold = DefaultableBoolean.True;

There’s gotta be some way to change the appearance of all GroupByRows with the UltraWinGrid / EpiUltraGrid (without looping through every row)

1 Like

This works for me! Just have to make sure you have the grid loaded with data before you try to set the bold property.

	void BoldTopLine()
	{
		EpiUltraGrid mesGrid;		
		mesGrid = (EpiUltraGrid)csm.GetNativeControlReference("724d4f74-671e-4121-a733-bc073bdb144d");
		UltraGridGroupByRow groupByRow = (UltraGridGroupByRow)mesGrid.Rows[0];
		groupByRow.Appearance.FontData.Bold = DefaultableBoolean.True;
	}

Thank you for your help!!!
Nate

1 Like

For the sake of completeness, here is my implementation:

	void BoldTopLine(String myRef)
	{
		EpiUltraGrid mesGrid;		
		mesGrid = (EpiUltraGrid)csm.GetNativeControlReference(myRef);
		UltraGridGroupByRow groupByRow = (UltraGridGroupByRow)mesGrid.Rows[0];
		groupByRow.Appearance.FontData.Bold = DefaultableBoolean.True;
	}

	private void edvV_Cust_OpenOrderRequests_Fast_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{	
			String myRef ="724d4f74-671e-4121-a733-bc073bdb144d";
			EpiUltraGrid mesGrid;		
			mesGrid = (EpiUltraGrid)csm.GetNativeControlReference(myRef);
			if (mesGrid.Rows.Count >=1)
			{
				BoldTopLine(myRef);
			}
	}

This works perfectly! Woooo!!!

1 Like

For anyone searching in the future, to make all GroupBy rows bold, just change Nate’s code for the BoldTopLine() method to the following:

	void BoldTopLine ( String myRef ) 
	{	
		EpiUltraGrid myGrid;
		myGrid = (EpiUltraGrid)csm.GetNativeControlReference(myRef);
		
		foreach ( var row in (RowsCollection)myGrid.Rows ) 
		{
			if ( row is UltraGridGroupByRow ) 
				row.Appearance.FontData.Bold = DefaultableBoolean.True;
		}
	}