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

Cursor in grid "blend" theme dissapears

5 Answers 196 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
HDC
Top achievements
Rank 1
HDC asked on 03 Aug 2012, 12:32 PM
Hi,

Please take a look at following sample:

https://skydrive.live.com/redir?resid=B8AA36071C47A567!347

This is a demo of a grid styled in Blend theme.

When I click on the first column in the first row, i see a cursor for typing in the textbox, but when i click on the next column in the grid, the cursor disappears never to reappear again.

This is annoying problem as i am sure everybody will understand, is there a solution to this problem?

Best Regards,

Peter

5 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 03 Aug 2012, 02:27 PM
Hi Peter,

Thank you for the project sent. We were able to reproduce the problem and we will do our best to provide a fix for one of our next internal builds.

Excuse us for the inconvenience caused. Your Telerik points have been updated accordingly.

Regards,
Vera
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Vanya Pavlova
Telerik team
answered on 06 Aug 2012, 01:12 PM
Hello Peter,

 

We have spent some time to research your case! Rather unfortunately it seems that this issue is directly related to a bug in the TextBox control, please check this thread in Microsoft Connect. Let me try to explain how is this related to our controls. Especially for our Expression_Dark theme we have set the CaretBrush property of the TextBox to be a light color (#FFDDDDDD), the default black color is not distinguishable over the brown background of the control in this theme. As you know we provide theme support for several native Microsoft controls, however we do not have direct access to the source of these controls.  
For the time being I may suggest you to track the progress of this case in the link provided above.  
Please excuse us for any inconvenience caused!



Greetings,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
HDC
Top achievements
Rank 1
answered on 06 Aug 2012, 01:29 PM
Hi Vanya,

For me this means that the blend theme should either be removed from the components or a "Known Issue" has to be included into the documentation of the toolset, warning everyone that there is an issue with input fields.

Why doesn't telerik build a Textbox from scratch that does not have the issue, can't be too hard, given the other controls that Telerik has build... this should be a walk in the park.

In any case, its disappointing to me that Telerik just leaves it up to microsoft to fix its stuff. We already know they are not going to fix this anytime soon.

Best Regards,

Peter
0
HDC
Top achievements
Rank 1
answered on 06 Aug 2012, 01:55 PM
Hi Vanya,

I found following link claiming there is a workarround, but to apply it, i suppose i would need to override the layout of the textbox.

http://forums.silverlight.net/p/165276/423268.aspx

One of these guys (suedama1756) actually wrote a behavior to fix it.

I'm just thinking it may be much easier for Telerik to build this workarround into the components.

Best Regards,

Peter
0
Lancelot
Top achievements
Rank 1
answered on 08 Aug 2012, 02:57 PM
Hi Peter,

Thank you for sharing that thread! I'm posting the workaround below (created by Jason Young) for other Telerikians to see:

The helper class:

public class FixCaretBrushBehavior
   {
      public static readonly DependencyProperty CaretBrushproperty = DependencyProperty.RegisterAttached(
         "CaretBrush", typeof(Brush), typeof(FixCaretBrushBehavior), new PropertyMetadata(CaretBrushChanged));
 
 
      private static void CaretBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
      {
         var textBox = d as TextBox;
         if (textBox != null)
         {
            var oldValue = (Brush)e.OldValue;
            var newValue = (Brush)e.NewValue;
            if (oldValue != newValue)
            {
               if (oldValue == null)
                  textBox.GotFocus += OnTextBoxFocus;
               if (newValue == null)
                  textBox.GotFocus -= OnTextBoxFocus;
            }
         }
      }
 
 
      private static void OnTextBoxFocus(object sender, RoutedEventArgs e)
      {
         var typedSender = (TextBox)sender;
         typedSender.CaretBrush = GetCaretBrush(typedSender);
      }
 
 
      public static Brush GetCaretBrush(TextBox textBox)
      {
         return (Brush)textBox.GetValue(CaretBrushproperty);
      }
 
 
      public static void SetCaretBrush(TextBox textBox, Brush value)
      {
         textBox.SetValue(CaretBrushproperty, value);
      }
   }

And here is the setter

<Setter Property="Behaviors:FixCaretBrushBehavior.CaretBrush" Value="White" />


Thanks,
Lancelot
Tags
GridView
Asked by
HDC
Top achievements
Rank 1
Answers by
Vera
Telerik team
Vanya Pavlova
Telerik team
HDC
Top achievements
Rank 1
Lancelot
Top achievements
Rank 1
Share this question
or