Cell_Formatting any effects

3 posts, 1 answers
  1. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 30 Jun Link to this post

    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. Answer
    Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 01 Jul Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 01 Jul in reply to Dimitar Link to this post

    Thank you very much!
Back to Top