Completed
Last Updated: 13 Jan 2017 10:58 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 10 Nov 2016 09:54
Category: GridView
Type: Bug Report
1
FIX. RadGridView - alternating row color is not applied for rows with selected sell when using GridViewSelectionMode.CellSelect
To reproduce: populate the grid with data and use the following code snippet:

Me.RadGridView1.EnableAlternatingRowColor = True
Me.RadGridView1.TableElement.AlternatingRowColor = Color.LightGray
Me.RadGridView1.MultiSelect = True
Me.RadGridView1.SelectionMode = Telerik.WinControls.UI.GridViewSelectionMode.CellSelect

Select multiple cells from different rows. You will notice that alternating color is not applied to the rows for which you have a selected cell. The attached gif file illustrates the behavior. 

Workaround:

Sub New() 
    InitializeComponent()
    Me.RadGridView1.MultiSelect = True
    Me.RadGridView1.SelectionMode = Telerik.WinControls.UI.GridViewSelectionMode.CellSelect
End Sub
Private Sub RadGridView1_CellFormatting(sender As Object, e As Telerik.WinControls.UI.CellFormattingEventArgs) _
Handles RadGridView1.CellFormatting
    e.CellElement.DrawFill = True
    e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
    If e.CellElement.IsSelected Then
        e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
    ElseIf e.CellElement.RowInfo.Index Mod 2 = 0 Then
        e.CellElement.BackColor = Color.White
    Else
        e.CellElement.BackColor = Color.LightGray
    End If 
End Sub
0 comments