This is a migrated thread and some comments may be shown as answers.

How to paint cell on rowFormatting?

0 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nickolay
Top achievements
Rank 1
Nickolay asked on 01 Aug 2017, 12:24 PM

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?

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Nickolay
Top achievements
Rank 1
Share this question
or