Since this is a runtime question, I am asking this here.
When a grid row is set to Activation.Disabled, using the Office2007 look and feel, the grid row changes color. I want this same color when the row is NoEdit. I want to be able to select the row, but it look the same.
Plus, I am using AppThemes, so I need to make sure you use ResolveAppearance. So here is what I am doing.
Infragistics.Win.AppearanceData ad = new Infragistics.Win.AppearanceData();gridControl.Grid.Rows.GetRowWithListIndex(i).ResolveAppearance(ref ad);gridControl.Grid.Rows.GetRowWithListIndex(i).CellAppearance.BackColor = ad.BackColorDisabled;gridControl.Grid.Rows.GetRowWithListIndex(i).CellAppearance.ForeColor = ad.ForeColorDisabled;
Now, I am not sure which Layout or appearance i should be calling Resolve on. I tried DisplayLayout of the entire grid and I also tried the Row's Resolve appearance above. Can someone tell me the right appearance or method to use? I tried even looking in the AppStyler and I don't ever see that color on any property of a GridRow.
Thanksjeff
Hi Jeff,
ResolveAppearance is going to give you the actual appearance of a cell at the time you call it. So if you want the appearance of a disabled cell, then your grid would actually have to have a disabld cell and you would call ResolveAppearance on that cell. So I guess you could disable a cell just for the purpose of getting the resolved appearance and then re-enabled it.
I have a WinForms app, uses AppStyler. I use the Office2007 color scheme in my styles but have about 6 different colors. I basically blended the office themes with another color to make a red, green, and purple office 2007 color style. So at runtime, I don't know if I am red, green, blue, gold, whatever.
The UltraGrid, when a row is set to Disabled (Activation) or the total grid is disabled, it changes the color of the row. So, I am looping through all the rows, setting the row's Activation property based on some logic. Instead of disabling the row, I want to set the Activation to NoEdit so they can still select and double click the row in the grid. But, I want the row to have the color of being disabled. Since I use themes, I can't don't get the correct color by going to the grid's display layout. From reading here, I needed to call ResolveAppearance to get the resolved colors of controls from an AppStyle.
But, I can't figure out which colors to be looking at on the grid to get the resolved colors. Is it the Row, the Cell, what? Again, the grid when disabled, or a row is disabled, changes color. I want those colors from the grid.
I have it working for now hitting the Office2007ColorTable or whatever looking at the EditorBackColorDisabled and EditorForeColorDisabled properties (might be wrong on spelling, but you get the idea). But, I want to get the colors from the Grid. If I am using a theme that doesn't use Office2007 look and feel, getting the colors from the color table won't work.
jeff
I'm afraid you lost me. I don't understand your question.
Just on a side note, however, the code you have posted here is very inefficient. Calling GetRowWithListIndex 3 times is a waste. You should get the row once and store it in a varaible and then access it's properties as much as you want. :)
I finally answered my own question. I am looking at the Office2007ColorTable.
But what if I am not using Office2007 colors in one of my themes? Maybe one of my themes is using the XP look or the Office 2003 look. Surely there has to be a way to get the current colors from the grid itself.