Cursor in grid "blend" theme dissapears

6 posts, 0 answers
  1. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 03 Aug 2012 Link to this post

    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
  2. Vera
    Admin
    Vera avatar
    265 posts

    Posted 03 Aug 2012 Link to this post

    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.

  3. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 06 Aug 2012 Link to this post

    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.

  4. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 06 Aug 2012 Link to this post

    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
  5. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 06 Aug 2012 Link to this post

    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
  6. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 08 Aug 2012 Link to this post

    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
Back to Top