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

Cell_Formatting any effects

2 Answers 39 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dario Concilio
Top achievements
Rank 2
Dario Concilio asked on 30 Jun 2016, 10:05 AM

Hi to all,

I have this method, I'm trying to format in backcolor only column editable.

I setted all columns with ReadOnly = True, and then I setted only particular Column ReadOnly = False

Now I would test if I format cells by Name or by ReadOnly status, but in both ways, BackColor appears Yellow only when I doubleclick into editable cell.

I would show to user the editable columns with Yellow backcolor.

How can I do?

01.Private Sub UpdateCellFormatting(ByRef e As CellFormattingEventArgs)
02. 
03.    Dim _IsEditable As Boolean = False
04. 
05.    If _SelectedItem IsNot Nothing Then
06. 
07.        If _SelectedItem.Personalizzazione = ListinoCliente.StringaListinoStandard Then
08. 
09.            If e.CellElement.ColumnInfo.FieldName = "PrezzoListino" Then
10.                _IsEditable = True
11.            End If
12. 
13.        Else
14. 
15.            If e.CellElement.ColumnInfo.FieldName = "Sconto" Then
16.                _IsEditable = True
17.            End If
18. 
19.        End If
20. 
21.    End If
22. 
23.    If _IsEditable Then
24.        e.CellElement.BackColor = Drawing.Color.Yellow
25.    Else
26.        e.CellElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local)
27.    End If
28. 
29.End Sub

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 01 Jul 2016, 08:02 AM
Hello Potito,

Thank you for writing.

You need to set the DrawFill property to true. And example is available here: Formatting Cells.

Let me know if I can assist you further.

Regards,
Dimitar
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Dario Concilio
Top achievements
Rank 2
answered on 01 Jul 2016, 08:19 AM
Thank you very much!
Tags
GridView
Asked by
Dario Concilio
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
Dario Concilio
Top achievements
Rank 2
Share this question
or