Search code examples
asp.netdevexpressxtrareport

ASP.NET XtraReports Gridview RowCellStyle


Is there any possible way to change Gridview CellStyle while printing XtraReports?

Some approach from Winforms;

Protected Sub dg_listeOzet_RowCellStyle(sender As Object, e As RowCellStyleEventArgs) Handles gv_listeOzet.RowCellStyle
 e.Appearance.BackColor = Color.LightBlue    
End Sub

Solution

  • I found a solution referring this problem. As you know, when you create XtraReports in winforms, it is created with two codefiles which are desing file and code file.

    you can copy all of codes from desing class and code class from the WinForm project and paste them into a new class created in a ASP.NET project.

    This enables you to catch

        Private Sub gv_ListeOzetCritical_RowCellStyle(sender As Object, e As RowCellStyleEventArgs) Handles gv_ListeOzetCritical.RowCellStyle, gv_listeOzet.RowCellStyle
    

    this event in the code file. when you full the gridview, this code event works and colour cells whichever you want.