Currently, I have changed the way we are going a little bit. I am now trying to highlight the column headers based on whether or not there is a DMR against the job listed in a second BAQ dataset I’m looking against. This is a snapshot of the functionality I’m seeing currently:
The issue with what is shown above is that some columns that shouldn’t be highlighted are. In this instance, both the Opr and Operation columns are highlighted when they shouldn’t be. Below is the current version of the chunk of code causing the color.
this.eugLocations.SupportThemes = true;
foreach( UltraGridColumn col in this.eugLocations.DisplayLayout.Bands[0].Columns )
{
foreach(DataRow row2 in dtResults2.Rows)
{
string strCurrentJob2 = (string)row2["DMRHead_JobNum"];
if(strCurrentJob2 == strCurrentJob)
{
eugLocations.BeginUpdate();
eugLocations.SuspendRowSynchronization();
col.Header.Appearance.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent;
col.Header.Appearance.BackColor = System.Drawing.Color.Yellow;
col.Header.Appearance.ForeColor = System.Drawing.Color.Black;
col.Header.Appearance.BackColorDisabled = System.Drawing.Color.Orange;
eugLocations.ResumeRowSynchronization();
eugLocations.EndUpdate();
break;
}
}
}
I believe that the " foreach( UltraGridColumn col in this.eugLocations.DisplayLayout.Bands[0].Columns )" line of code is what is causing both of them to be highlighted. Is there a better way to highlight each column header independently instead of saying for each column?
Below are some links to where I got my bits of code from:
Hate to bother you guys, but do either of you know how to do this?