Modifying The Color of an EpiDataView Row

I have been working on a dashboard customization but I have not been able to figure out a specific section that has me stuck. My dashboard queries the LaborHed and EmpBasic tables (sorting by employee name ascending) and simply shows all employees that clocked in through MES for a specific day and their hours worked on that clock in. My goal with this customization is to highlight the employee’s name field when there are duplicate entries back-to-back. For Example: Employee ‘Bob’ had 2 clock-ins today, resulting in 2 entries with different times and pay hours, i would like my customization to highlight the second occurrence of Bob in the table.

I first tried using the Wizard Row Rules with a Custom Condition but I could not figure out a way to prevent it from reassessing every time a row was selected (this entire dashboard is update-able so there will be a lot of row updates that will happen)

After suspending my attempt with row rules I have been trying a different path. I created a Form Event on AterToolClick using the wizard, I then have it call a custom function when the user has clicked the refresh tool (the dashboard does not auto-refresh so the user is forced to refresh to query). The custom function loops through all of the grid rows and attempts to change the SettingStyle if the current and previous grid row are for the same employee. I am trying to use the SetCurrentRowProperty() and it does work but not as intended - even though I believe I have set the EpiDataView’s current row with mainDV.Row = i when I run the dashboard it will highlight the entire employee name column, not just the current row’s employee name.

	private void DuplicateAssess(){
		EpiUltraGrid mainGrid = (EpiUltraGrid)csm.GetNativeControlReference("123b945d-d2e9-4d5e-a27c-0414a1b7475a");
		EpiDataView mainDV = (EpiDataView)this.oTrans.EpiDataViews["V_CTGI_UpdatePayHours_1View"];
		for(int i=0; i<mainGrid.Rows.Count; i++){
			//back checking - make sure within index range
				//check if this is a duplicate row (same employee) - change the style of that row/field
				if(mainGrid.Rows[i].Cells["EmpBasic_Name"].Value.ToString() == mainGrid.Rows[i-1].Cells["EmpBasic_Name"].Value.ToString()){
					//set the current row in the EpiDataView
					mainDV.Row = i;
					//attempt to change the current row property
					mainDV.SetCurrentRowProperty("EmpBasic_Name", SettingStyle.Warning);

Does anyone have any ideas as to why this is or how I could accomplish this in a different way? (I know life is way easier with Row Rules but I could not get them to work for this situation)

Thank you!

Since this is coming from a BAQ, you can add a field there that would flag your row. Then you can use Row Rules to set the background color.


You are referencing a grid, and a dataview.

If I recall correctly, the rows may not be the same index for each.

That makes sense and to be honest I was debating on going this route or a BPM (probably data directive) if I couldn’t figure out how to have it done in a customization. I think I’m too stubborn to accept defeat here but it may be time to just move on and switch paths. Thanks for helping Jason!

I was thinking that earlier but if I use a messagebox to show me a field value from the current row (after I have set mainDV.Row = i) it does get the correct value so I’m relatively confident that I have changed the current row of the EpiDataView.

Edit: I did just double check and I am setting the current row in the EpiDataView - the following line produced the expected result MessageBox.Show(mainDV.CurrentDataRow["EmpBasic_Name"].ToString());

Is there any kind of documentation on Methods (ie. SetCurrentRowProperty) aside from the Object Explorer? I truly don’t understand why this method would set the entire columns style not just the field within the current row and specified column

Since this is data-driven, you likely want the logic to be server-side, thus a BPM.

Jason Woods