StyleSelector null-return bug

5 posts, 0 answers
  1. Aleksey
    Aleksey avatar
    13 posts
    Member since:
    Nov 2012

    Posted 14 May 2014 Link to this post

    Have view with RadGridView with RowStyleSelector:
    <telerik:RadGridView
     ...
          RowStyleSelector="{StaticResource myStyle}"
    ...
    />

    And resources is:
    <Grid.Resources>
      <localss:MyStyle x:Key="myStyle">
        <localss:MyStyle.UneditableStyle>
          <Style TargetType="telerik:GridViewRow" BasedOn="{StaticResource GridViewRowStyle}">
            <Setter Property="Background" Value="LightGray" />
          </Style>
        </localss:MyStyle.UneditableStyle>
      </localss:MyStyle>
    </Grid.Resources>



    RowStyleSelector is next:
    public class MyStyle: StyleSelector
    {
        public override Style SelectStyle(object item, DependencyObject container)
        {
            var s = item as MyObject;
            if (s == null)
                return null;
            if (!s.Editable)
                return UneditableStyle;
            return null;           
        }
         
        public Style UneditableStyle { get; set; }
    }

    In Silverlight UI 2013 Q3 appear following bug:
    When s.Editable is false, style color (UneditableStyle) row correct.
    When s.Editable becomes true, SelectStyle return null , but row was still colored and it's style is UneditableStyle, not default style (no style) as it was in 2013 Q2. But it must be default.
  2. Aleksey
    Aleksey avatar
    13 posts
    Member since:
    Nov 2012

    Posted 15 May 2014 in reply to Aleksey Link to this post

    2013Q3SP2 fix it.
  3. DevCraft banner
  4. Aleksey
    Aleksey avatar
    13 posts
    Member since:
    Nov 2012

    Posted 15 May 2014 Link to this post

    Oh, not. Maybe not. Visual Studio option for Silverlight "Reduce XAP size by using application library caching" run old version so I cannot try it now.
  5. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 16 May 2014 Link to this post

    Hello Aleksey,

    Indeed, you are right. I was able to reproduce the problem with our latest version of RadGridView. I have logged this issue in our bug tracking system for further investigation.

    Thank you for reporting this, I updated your Telerik points accordingly. 


    Regards,
    Yoan
    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.
     
  6. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 02 Jun 2014 Link to this post

    Hello Aleksey,

    Just a quick follow-up : 

    The problem has been logged into our Feedback portal as bug report. You can track the status of the issue by following the feedback item: Row's style is not updated when the SelectStyle method of RowStyleSelector returns null. Once we have a progress we will change its status.

    Regards,
    Yoan
    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
DevCraft banner