TextViewCellFormatting - Backcolor Row

3 posts, 1 answers
  1. Frank
    Frank avatar
    8 posts
    Member since:
    Aug 2014

    Posted 15 Dec 2014 Link to this post

    I want to change the background color of a row if the progress is 100%.
    Foreground color is changeable background color not.
    What am I doing wrong?


       Private Sub rGanttProjekteliste_TextViewCellFormatting(sender As Object, e As GanttViewTextViewCellFormattingEventArgs) _
                                                                            Handles rGanttProjekteliste.TextViewCellFormatting
            Dim headercelltyp As Type = GetType(GanttViewTextViewHeaderCellElement)
            Dim elementcelltyp As Type = e.CellElement.GetType()
            If Not headercelltyp.IsAssignableFrom(elementcelltyp) Then
                If e.Item.Level = 1 Then
                    e.CellElement.Font = New Font(e.CellElement.Font, FontStyle.Bold)
                End If
                If e.Item.Progress = 100 Then
                    e.CellElement.BackColor = Color.Gray
                    e.CellElement.BackColor = Color.White
                End If
            End If
        End Sub
  2. Answer
    Dess avatar
    1563 posts

    Posted 16 Dec 2014 Link to this post

    Hello Frank,

    Thank you for writing.

    In the TextViewCellFormatting event it is necessary to set the DrawFill property to true in order to obtain the correct coloring. You can refer to our GanttView >> TextView item formatting help article which is quite useful on this topic.

    Note that Font creation is a heavy operation and it is not recommended to be performed in the formatting event which is fired a lot of times. I would recommend you to create the font just once and use the font variable in the TextViewCellFormatting event.

    I hope this information helps. Should you have further questions, I would be glad to help.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
  4. Frank
    Frank avatar
    8 posts
    Member since:
    Aug 2014

    Posted 16 Dec 2014 in reply to Dess Link to this post

    Thank you for your help
Back to Top