ItemContainerStyleSelector not working

5 posts, 1 answers
  1. Adrien
    Adrien avatar
    7 posts
    Member since:
    Sep 2011

    Posted 28 May 2013 Link to this post

    Hello,

    The ItemContainerStyleSelector on the RadListBox is not working.

    Here is what I did:

    public class SpeakerStyleSelector : StyleSelector
        {
            public Style NoEmailSpeakerStyle { get; set; }
     
            public override Style SelectStyle(object item, DependencyObject container)
            {
                if (item is Speaker)
                    return this.NoEmailSpeakerStyle;
     
                return null;
            }
        }
    }



    <Style x:Key="NoEmailSpeakerItemContainerStyle" TargetType="telerik:RadListBoxItem">
         <Setter Property="Foreground" Value="Red"/>
    </Style>
             
    <local:SpeakerStyleSelector x:Key="SpeakerItemContainerStyleSelector"
                        NoEmailSpeakerStyle="{StaticResource NoEmailSpeakerItemContainerStyle}"/>
     
     
    ...
     
     
    <telerik:RadListBox   ItemsSource="{Binding Speakers}"
                   ItemContainerStyleSelector="{StaticResource SpeakerItemContainerStyleSelector}" />

    The SelectStyle method is never called.

    BTW, if I set directly the NoEmailSpeakerItemContainerStyle with the ItemContainerStyle, it works fine!



    Regards,
    Adrien.
  2. Answer
    Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 29 May 2013 Link to this post

    Hello Adrien,

    We've tried the provided code but we didn't manage to reproduce the issue using our latest release (Q1 2013 SP1) - the SelectStyle method was called correctly at our side. Can you confirm that you're using the latest version of the controls? Also any additional information about the exact scenario you could provide, will be helpful.

    I'm looking forward to your response.

    Regards,
    Kalin
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Adrien
    Adrien avatar
    7 posts
    Member since:
    Sep 2011

    Posted 29 May 2013 Link to this post

    I wasn't using the lastest version.

    I got the Q3 2012 and it works fine.


    Thanks.
  5. Bruno
    Bruno avatar
    54 posts
    Member since:
    Jul 2012

    Posted 18 Apr Link to this post

    Hi Telerik

    Could it be possible that the ItemContainerStyleSelector again didn't working on the RadListBox?
    I'm using the actual Version of the Telerik Controls für Silverlight.

    Kind regards,
    Bruno

  6. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 19 Apr Link to this post

    Hello Bruno,

    We are not aware of any issues with the ItemContainerStyleSelector of RadListBox. Can you please share some more details regarding the exact scenario and issue you are observing?

    I'm looking forward to hearing from you.


    Regards,
    Kalin
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
DevCraft banner