Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
Styling rows depending of cell values
posted

Good day.

I have an UltraGrid with some columns and rows, such as:

id, some data, ReadStatus-(boolean value)

1  Peter Adams true

2 John Smith false

I want to display the rows in bold, where the cell value(in ReadStatus) is equal to true, as in the Outlook.

I can get around all the rows in the cycle after filling the dataset and set the style values, but, when I have large amounts of data, the UltraGrid begins to take a long time.

Is there a way to assign style of each row when filling dataset?

 

P.S. Sorry for my English, its not my native language.

Parents
No Data
Reply
  • 69832
    Offline posted

    UltraGridColumn supports condition-based appearances, which provide a way to apply visual attributes based on a cell value. In your case you would do something like this:


    ConditionValueAppearance cva = new ConditionValueAppearance();

    Infragistics.Win.OperatorCondition condition = new OperatorCondition(ConditionOperator.Equals, true);

    Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance();
    appearance.FontData.Bold = DefaultableBoolean.True;

    cva.Add( condition, appearance );

    column.ValueBasedAppearance = cva;

Children