Black Background since last Update

4 posts, 1 answers
  1. Marc
    Marc avatar
    15 posts
    Member since:
    Apr 2013

    Posted 08 Jul 2014 Link to this post

    Hi, i have a Problem withTextboxes, after using the new Telerik DLL's (2014.2.617.40)
    When setting the Enabled property to False, the3 Background of the Textboxes changes to Black. In the previous release (2014.1.402.40) this did not happen.
    Attached a jpg with the Error.

    Thank You
  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 10 Jul 2014 Link to this post

    Hello Mark,

    We are aware of this issue and it is already logged in our Feedback Portal. You can track the item for status changes and add your vote for it here

    Workaround is available in the issue page.

    I have noticed that you have posted similar to this thread one more time. I assume that you have added it by mistake and I will delete it in order to avoid duplicate threads in or forum.

    I hope this helps.

    Regards,
    Dimitar
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Marc
    Marc avatar
    15 posts
    Member since:
    Apr 2013

    Posted 11 Jul 2014 in reply to Dimitar Link to this post

    Thank you,

    sorry for the double post, you're right, didn't noticed that.

    Works like a charm. Uploaded a short Utility Class so that you dont have to set the Color for every single Input element.

    01.Public Class TelerikUtils
    02.    Public Shared Sub WorkaroundBlackbackground(ByVal page As Control)
    03.        Dim controles As New List(Of Control)
    04.        For Each item As Control In FindControlRecursive(controles, page, GetType(Telerik.WinControls.UI.RadTextBox))
    05.            FixBlackColor(item)
    06.        Next
    07.        For Each item As Control In FindControlRecursive(controles, page, GetType(Telerik.WinControls.UI.RadMaskedEditBox))
    08.            FixBlackColor(item)
    09.        Next
    10.        For Each item As Control In FindControlRecursive(controles, page, GetType(Telerik.WinControls.UI.RadDateTimePicker))
    11.            FixBlackColor(item)
    12.        Next
    13.    End Sub
    14. 
    15.    Private Shared Sub FixBlackColor(ByVal item As Object)
    16.        If TypeOf (item) Is Telerik.WinControls.UI.RadTextBox Then
    17.            Dim res = CType(item, Telerik.WinControls.UI.RadTextBox)
    18.            If Not res.Enabled Then res.RootElement.BackColor = Color.White
    19.        ElseIf TypeOf (item) Is Telerik.WinControls.UI.RadMaskedEditBox Then
    20.            Dim res = CType(item, Telerik.WinControls.UI.RadMaskedEditBox)
    21.            If Not res.Enabled Then res.MaskedEditBoxElement.TextBoxItem.BackColor = Color.White
    22.        ElseIf TypeOf (item) Is Telerik.WinControls.UI.RadDateTimePicker Then
    23.            Dim res = CType(item, Telerik.WinControls.UI.RadDateTimePicker)
    24.            If Not res.Enabled Then res.DateTimePickerElement.TextBoxElement.TextBoxItem.BackColor = Color.White
    25.        End If
    26.    End Sub
    27. 
    28.    Private Shared Function FindControlRecursive(ByVal list As List(Of Control), ByVal parent As Control, ByVal ctrlType As System.Type) As List(Of Control)
    29.        If parent Is Nothing Then Return list
    30.        If parent.GetType Is ctrlType Then
    31.            list.Add(parent)
    32.        End If
    33.        For Each child As Control In parent.Controls
    34.            FindControlRecursive(list, child, ctrlType)
    35.        Next
    36.        Return list
    37.    End Function
    38.End Class

    Just add after Form initialization the following code

    1.TelerikUtils.WorkaroundBlackbackground(Me)

    And you are good to go

    Thank you
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 15 Jul 2014 Link to this post

    Hi Marc,

    Thanks for sharing this with the community. You can also post it as a comment to the feedback item.

    Regards,
    Stefan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top