Hi
I have in my grid one column that is pinned. User can also select many rows.
Problem is that when many rows are selected cells from pinned column for these rows doesn’t change background – take a look on screen shot.
For pinned column I use standard GridViewTextBoxColumn.
If this column is not pinned this problem doesn`t occur.
How can I resolve this problem?
Regards
12 Answers, 1 is accepted
Hoe you're well. Curiously, if you select lots of rows using the mouse, but avoid mousing over the pinned column, the pinned column back colour is correct, whereas if you include the pinned column in the mouse drag selection, then it stays blue. I'll have a look at this for you.
Richard
Yes, you exactly described problem.
I cannot figure out how to solve this problem.
Can you try this please.
Private Sub RadGridView1_CellFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting If e.CellElement.ColumnInfo.IsPinned AndAlso e.CellElement.RowInfo.IsSelected Then e.CellElement.BackColor = Color.FromArgb(255, 231, 174) Else e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local) End IfEnd SubLet me know if that looks any good
Thanks
Richard
almost perfect :)
There is only very small difference that you can see in attachments (when I use this workaround cells in pinned column have blue border) but I will mark your post as answer.
Glad that looks good. You should be avble to set the border colours in the same way
Private Sub RadGridView1_CellFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting If e.CellElement.ColumnInfo.IsPinned AndAlso e.CellElement.RowInfo.IsSelected Then e.CellElement.BackColor = Color.FromArgb(255, 231, 174) e.CellElement.BorderColor = Color.FromArgb(255, 231, 174) Else e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local) e.CellElement.ResetValue(LightVisualElement.BorderColorProperty, ValueResetFlags.Local) End IfEnd SubHope that helps
Richard
there is still small problem with borders - I don`t know why it works fine for cell back color but not for cell border color
I'm finding this very tricky to see on my laptop. If this bothers you I'll keep looking, but my advise first would be to play with setting all border and back colour properties, and reseting them in the same way as I have done with the back colour.
Hope that helps
Richard
I can live with this issue but I don`t know if it is acceptable for my clients
Would be nice if you found solution…
Richard
Can you try this please.
Private Sub RadGridView1_CellFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting If e.CellElement.ColumnInfo.IsPinned AndAlso e.CellElement.RowInfo.IsSelected Then e.CellElement.BackColor = Color.FromArgb(255, 231, 174) e.CellElement.BorderTopColor = Color.FromArgb(255, 190, 106) e.CellElement.BorderBottomColor = Color.FromArgb(255, 190, 106) e.CellElement.BorderTopShadowColor = Color.White e.CellElement.BorderBottomShadowColor = Color.White Else e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local) e.CellElement.ResetValue(LightVisualElement.BorderTopColorProperty, ValueResetFlags.Local) e.CellElement.ResetValue(LightVisualElement.BorderBottomColorProperty, ValueResetFlags.Local) e.CellElement.ResetValue(LightVisualElement.BorderBottomColorProperty, ValueResetFlags.Local) e.CellElement.ResetValue(LightVisualElement.BorderBottomColorProperty, ValueResetFlags.Local) End IfEnd SubLet me know how that is for you
Richard
How did you read values for colors?
It would be better to not use card coded values.
Can I read somehow these colors from grid ?
Regards
I used a freeware colour picker (Huey). I guess they could be read from the next cell, but I wanted to give you a solution based on a default theme as soon as possible.
I'm glad that looks like a good workaround for you.
Richard