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

Black Background since last Update

3 Answers 35 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 08 Jul 2014, 09:25 AM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 10 Jul 2014, 01:46 PM
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.
 
0
Marc
Top achievements
Rank 1
answered on 11 Jul 2014, 09:40 AM
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
0
Stefan
Telerik team
answered on 15 Jul 2014, 02:53 PM
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.
 
Tags
TextBox
Asked by
Marc
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Marc
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or