This is a migrated thread and some comments may be shown as answers.
Background colour not applied to Alternate rows in Boostrap Skin
3 Answers 29 Views
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 22 Nov 2017, 12:50 PM

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

3 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 27 Nov 2017, 01:18 PM
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.
0
Andy Green
Top achievements
Rank 2
answered on 29 Nov 2017, 08:22 AM

Hi Vessy

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

Andy

0
Vessy
Telerik team
answered on 29 Nov 2017, 01:25 PM
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.
Tags
Grid
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Vessy
Telerik team
Andy Green
Top achievements
Rank 2
Share this question
or