Background colour not applied to Alternate rows in Boostrap Skin

4 posts, 1 answers
  1. Andy Green
    Andy Green avatar
    376 posts
    Member since:
    Aug 2008

    Posted 22 Nov 2017 Link to this post

    Hi

    I have a simple Rad grid using the Bootstrap skin.

    Based on the data I'm using the ItemDataBound to change the row COlour, however its not being applied to Alternate rows.

    How can I fix this?

    Here is my code:

    Protected Sub rgHousekeeping_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgHousekeeping.ItemDataBound
     
        If TypeOf e.Item Is GridDataItem Then
     
            Dim RowDataItem As GridDataItem = CType(e.Item, GridDataItem)
            Dim TaskComplete As System.Web.UI.WebControls.Image = DirectCast(RowDataItem("TaskComplete").Controls(0), System.Web.UI.WebControls.Image)
     
            If CBool(e.Item.DataItem("TaskComplete")) Then
                TaskComplete.ImageUrl = "Content/Images/Tick_24.png"
            Else
                RowDataItem.BackColor = Drawing.ColorTranslator.FromHtml("#ff7474")
            End If
     
        End If
     
    End Sub

     

    Andy

  2. Answer
    Vessy
    Admin
    Vessy avatar
    2023 posts

    Posted 27 Nov 2017 Link to this post

    Hi Andy,

    We are aware of the described problem and it is related to a known bug, specific to the Bootstrap skin of the Grid. You can track its progress and vote in order to increase its priority in the following feedback item:
    https://feedback.telerik.com/Project/108/Feedback/Details/232564

    Meanwhile, you can workaround the issue by using the approach given by my colleague Eyup in the following form post:
    https://www.telerik.com/forums/alternatingitemstyle-5e16887f3085#odVQBomUikiIJfrxeBQrww

    Regards,
    Vessy
    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. Andy Green
    Andy Green avatar
    376 posts
    Member since:
    Aug 2008

    Posted 29 Nov 2017 in reply to Vessy Link to this post

    Hi Vessy

    Thank you - was able sort it, and +1 vote for the bug fix.

    Andy

  4. Vessy
    Admin
    Vessy avatar
    2023 posts

    Posted 29 Nov 2017 Link to this post

    Hi,

    You are welcome, Andy - I am glad the suggested workaround is applicable to your solution and the rows are colorized properly now.

    Regards,
    Vessy
    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.
Back to Top