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

Slider item with visible=false

1 Answer 41 Views
Slider
This is a migrated thread and some comments may be shown as answers.
James Shelton Agar
Top achievements
Rank 2
James Shelton Agar asked on 20 Sep 2010, 04:31 AM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetie
Telerik team
answered on 23 Sep 2010, 03:55 PM
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
Tags
Slider
Asked by
James Shelton Agar
Top achievements
Rank 2
Answers by
Tsvetie
Telerik team
Share this question
or