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

Problem with pinned column and multiselection.

12 Answers 194 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raymond
Top achievements
Rank 1
Raymond asked on 02 Dec 2010, 12:02 PM

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

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 02 Dec 2010, 12:37 PM
Hi Raymond,

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
0
Raymond
Top achievements
Rank 1
answered on 02 Dec 2010, 12:41 PM

Yes, you exactly described problem.

I cannot figure out how to solve this problem.

0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 02 Dec 2010, 01:08 PM
Hi Raymond,

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 If
End Sub

Let me know if that looks any good
Thanks
Richard
0
Raymond
Top achievements
Rank 1
answered on 02 Dec 2010, 02:31 PM

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.

 


0
Richard Slade
Top achievements
Rank 2
answered on 02 Dec 2010, 03:03 PM
Hi Raymond,

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 If
End Sub

Hope that helps
Richard
0
Raymond
Top achievements
Rank 1
answered on 02 Dec 2010, 03:09 PM
did not help
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
0
Richard Slade
Top achievements
Rank 2
answered on 02 Dec 2010, 03:16 PM
Hi Raymond,

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
0
Raymond
Top achievements
Rank 1
answered on 02 Dec 2010, 03:18 PM

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…

0
Richard Slade
Top achievements
Rank 2
answered on 02 Dec 2010, 03:44 PM
I'll do my best to find something for you, Raymond.
Richard
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 02 Dec 2010, 04:33 PM
Hi Raymond,

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 If
End Sub

Let me know how that is for you
Richard
0
Raymond
Top achievements
Rank 1
answered on 03 Dec 2010, 03:39 PM
Now it is perfect, thanks.
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
0
Richard Slade
Top achievements
Rank 2
answered on 03 Dec 2010, 03:44 PM
Hi Raymond,

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
Tags
GridView
Asked by
Raymond
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Raymond
Top achievements
Rank 1
Share this question
or