I've got an UltraGrid displaying information in a detailed list like display (similar to the details view in windows explorer), and am using the ValueBasedAppearance property on the columns to to display conditional formatting for certain values. The grid has the SelectTypeRow set to Single (and the cell/col set as None) to give a completely selected row appearance, however this results in any cell in the current selected row to completely ignore the ValueBasedAppearance.
Can anyone suggest the best way to alter the appearance of these conditionally formatted cells to display differently when selected (not necessarily to the ValueBasedAppearance, just differently so the feedback to the user isn't totally lost when the row is selected)?
Thanks,
Sue
Thank you, the solution worked exactly as I wished.
Hello Sue,
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.
Hi Sue,
Thank you for the feedback.
Yes you will have to create a custom class, which implements IConditionContextProvider. You need to implement only the Context property, which is the object you provide. And also to set the selected appearance for each cell in a row you need to go through each cell using some sort of a loop.
I have modified my sample to implement a custom condition and an IConditionContextProvider class.
Please let me know if you have any additional questions.
Hi Dimitar,
That works beautifully, but I do have a couple of questions.
I'm using a custom condition implementation and was using the UltraGridCell that was being passed via the context object (to access the related list object), However the Infragistics.Win.UltraWinGrid.CellContextProvider class that it was passing doesn't seem to be public. Is there a way to get the instance of that class to pass through the Match call, or should I just write my own implementation of the interface?
One of my conditions tries to set a selected appearance across the entire row, is there a better way to achieve this other than iterating over the columns similar to:
foreach (var c in e.Row.Band.Columns) { e.Row.Cells[c].SelectedAppearance = lowApp; }
Many thanks,
Thank you for contacting Infragistics.
What you could do in your is to use the InitializeRow event of the grid to check the condition values and set the cell selected and normal appearances. This way even if the whole row is selected these cells will keep their conditional formatting as the cell appearance object overrides the row appearance for the specific cell.
I have attached a sample which demonstrates this suggestion.