Slider item with visible=false

2 posts, 1 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 19 Sep 2010 Link to this post

    I have the follow slider
    <telerik:RadSlider ID="slidersteps" runat="server" Value="0" ItemType="Item" Width="738px"
         Height="40px" DecreaseText="Previous" IncreaseText="Next" SelectionStart="1"
         ShowDecreaseHandle="False" ShowIncreaseHandle="False" OnClientBeforeValueChange="clientBeforeValueChange"
         AutoPostBack="true">
         <Items>
             <telerik:RadSliderItem Text="Select Product" Value="PRODUCT" />
             <telerik:RadSliderItem Text="Select Subscription" Value="SUBSCRIPTION" Enabled="false" />
             <telerik:RadSliderItem Text="Registration Details" Value="REGISTRATION" Enabled="false" Visible="false"  />
             <telerik:RadSliderItem Text="Payment Method" Value="METHOD" Enabled="false" />
             <telerik:RadSliderItem Text="Confirmation" Value="CONFIRM" Enabled="false" />
         </Items>
     </telerik:RadSlider>

    and the ticker doesn't go to the correct position with 1 item that has 
    Visible="false"
    
    and with items that not enabled, it is still clickable.
    
    any idea?
  2. Answer
    Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 23 Sep 2010 Link to this post

    Hi James Shelton Agar,
    The current version of RadSlider does not support items with Visible=false in its Items collection.

    Regarding the Enabled property, currently it influences only the style of the item. You can, however, implement the result you expect with disables items, using the client-side API of RadSlider. For example:
    <telerik:RadSlider ID="slidersteps" runat="server" Value="0" ItemType="Item" Width="738px"
        Height="40px" DecreaseText="Previous" IncreaseText="Next" SelectionStart="1"
        ShowDecreaseHandle="False" ShowIncreaseHandle="False" AutoPostBack="true" OnClientValueChanging="OnClientValueChanging">
        <Items>
            <telerik:RadSliderItem Text="Select Product" Value="PRODUCT" />
            <telerik:RadSliderItem Text="Select Subscription" Value="SUBSCRIPTION" Enabled="false" />
            <telerik:RadSliderItem Text="Registration Details" Value="REGISTRATION" sEnabled="false" />
            <telerik:RadSliderItem Text="Payment Method" Value="METHOD" Enabled="false" />
            <telerik:RadSliderItem Text="Confirmation" Value="CONFIRM" Enabled="false" />
        </Items>
    </telerik:RadSlider>
    <script type="text/javascript">
        function OnClientValueChanging(sender,args)
        {
            if (!sender.get_items()[args.get_newValue()].get_enabled())
                args.set_cancel(true);
        }
    </script>

    All the best,
    Tsvetie
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top