Child Template Backcolor

3 posts, 1 answers
  1. Toni
    Toni avatar
    2 posts
    Member since:
    Jan 2018

    Posted 23 Jan 2018 Link to this post

    Hi

    How could I adjust in VB.NET the backcolor of all my child templates?

    I mean the property equivalent to TableElement.BackColor for MasterTemplate

    I point that area in my attached file

     

    Thanks in advance

    Kind regards

  2. Answer
    Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 23 Jan 2018 Link to this post

    Hi Toni,

    Thank you for writing.

    You can achieve the desired result by handling the RadGridView.ViewCellForamtting event: 
    Private Sub RadGridView1_ViewCellFormatting(ByVal sender As Object, ByVal e As CellFormattingEventArgs)
        Dim detailCell As GridDetailViewCellElement = TryCast(e.CellElement, GridDetailViewCellElement)
        If detailCell IsNot Nothing Then
            detailCell.NumberOfColors = 1
            detailCell.BackColor = Color.LightGreen
        Else
            e.CellElement.ResetValue(LightVisualElement.NumberOfColorsProperty, Telerik.WinControls.ValueResetFlags.Local)
            e.CellElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local)
        End If
    End Sub

    Additional information on how the grid cells can be formatted is available here: https://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Toni
    Toni avatar
    2 posts
    Member since:
    Jan 2018

    Posted 24 Jan 2018 Link to this post

    It works! Thank you very much Hristo!
Back to Top