Search code examples
c#devexpressxtragridgridcontrol

Change font style in gridcontrol devexpress?


how can i make italic font based on ISVERIFIKASI value?? if ISVERIFIKASI value is 1 make it all row font to italic and if it is 0 make it to default regular...

this is my form

Any suggestion?


Solution

  • I suggest you use the GridView.RowStyle event.

    using DevExpress.XtraGrid.Views.Grid;
    //...
    void gridView_RowStyle(object sender, RowStyleEventArgs e) {
       GridView view = sender as GridView;
       if(e.RowHandle >= 0) {
          int value = (int)view.GetRowCellValue(e.RowHandle, view.Columns["ISVERIFIKASI"]);
          if(value == 1) 
             e.Appearance.Font = ...;
       }
    }