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

Alternative Row Background Colors

1 Answer 108 Views
ListControl
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 25 Jul 2012, 09:54 PM
I am using the VisualListItemFormatting event to achieve an alternating item background color effect like so:

Private _rowIndex As Integer = 0
    Private Sub cmb_VisualListItemFormatting(sender As Object, args As VisualItemFormattingEventArgs) Handles cmb.VisualListItemFormatting
        If _rowIndex Mod 2 = 0 Then
            args.VisualItem.SetValue(LightVisualElement.BackColorProperty, Color.FromArgb(224, 226, 255))
            args.VisualItem.SetValue(LightVisualElement.GradientStyleProperty, GradientStyles.Solid)
        End If
 
        _rowIndex = _rowIndex + 1
    End Sub

However, this appears to affect the mouse over background color. Here's the default mouseover on a row not impacted by the formatting above (note the entire background is highlighted):
http://screencast.com/t/AmWsEe7sYvwc

And here's the mouseover on a row impacted by the formatting (note that the background is not highlighted - only a border appears):
http://screencast.com/t/HD2AfEEs

How can I make these consistent? Preferably all of the items would have the entire background color changed. OR, is there a better way to achieve alternating item colors that would not cause this issue?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 30 Jul 2012, 08:16 AM
Hello,

Your question has already been answered in the support thread you've opened. Please, see our answer there for more information.

We kindly ask you to use just one support channel to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

Thank you for your understanding. 

All the best,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
ListControl
Asked by
Jason
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or