How to paint cell on rowFormatting?

1 posts, 0 answers
  1. Nickolay
    Nickolay avatar
    4 posts
    Member since:
    Jul 2017

    Posted 01 Aug 2017 Link to this post

    I've next code that handle rowFormatting my cells:

    private void gridViewRaces_RowFormatting(object sender, RowFormattingEventArgs e) {

        foreach (var cellColumn in e.RowElement.Data.Cells) {

        var cellInfo = cellColumn as GridViewCellInfo;

        if (cellInfo != null) {

        cellInfo.Style.DrawFill = true;

        if (cellInfo.ColumnInfo.Name == "columnContactProducerName") {

            cellInfo.Style.DrawFill = true; cellInfo.Style.BackColor = Color.Yellow; }

       else if (cellInfo.ColumnInfo.Name == "columnTransport") { cellInfo.Style.BackColor = Color.Yellow; }

       else { cellInfo.Style.BackColor = ColorTranslator.FromHtml((e.RowElement.Data.DataBoundItem as RaceForListDto).Color); } }

    }

    }
    but my cells aren't painting. How to paint some cells in rows on dataBinding?

Back to Top