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

Slider in a repeater

10 Answers 162 Views
Slider
This is a migrated thread and some comments may be shown as answers.
John Reid
Top achievements
Rank 1
John Reid asked on 27 Jan 2009, 04:17 AM
Hi-
I would like to place a radslider in a repeater and have it (them) act as a thumbnail viewer. Similar to http://demos.telerik.com/aspnet-ajax/Slider/Examples/CustomScrollbar/DefaultCS.aspx. Only the repeater would generate several sliders to show product in different categories.

I know that this is done with JavaScript and the changing of divs so I believe it is not possible inside a repeater.

Does anyone know of an other way I could accomplish this?

10 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 29 Jan 2009, 10:26 AM
Hi John,
The ClientValueChange and ClientLoaded handlers for a RadSlider accept two arguments - the RadSlider client object and an arguments object. You can use the slider object to determine which exact slider raised the event and execute the logic for that slider. For example, the following repeater:
<asp:Repeater ID="Repeater1" runat="server"
    <ItemTemplate> 
        <telerik:RadSlider ID="RadSlider1" runat="server"  
            OnClientValueChange="OnClientValueChange" 
            OnClientLoaded="OnClientLoaded"></telerik:RadSlider> 
    </ItemTemplate> 
</asp:Repeater> 
<script type="text/javascript"
function OnClientLoaded(sender, args) 
    var slider = sender
    alert(slider.get_id()); 
function OnClientValueChange(sender, args) 
    var slider = sender
    alert(slider.get_id()); 
</script> 

generates sliders with the following ClientIDs - Repeater1_ctl00_RadSlider1, Repeater1_ctl01_RadSlider1, Repeater1_ctl02_RadSlider1. You can get the ClientID of the slider that raised the event using the slider.get_id() method and use it to determine which DIV element you have to reposition.

All the best,
Tsvetie
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
sadeghhp
Top achievements
Rank 1
answered on 20 Apr 2009, 07:22 AM
hi !
im still in my problem!
i have some value in database and i show them by RADslider in a Repeater!
i want to update database by evry ghanges in sliders!
how?
http://i42.tinypic.com/168ehqu.png
0
Tsvetie
Telerik team
answered on 22 Apr 2009, 07:40 AM
Hello sadeghhp,
The RadSlider raises the OnValueChanged server side event when its value changes. In order for the slider to raise this event, you need to set the AutoPostBack property of the slider to "true". That is why, you need to handle the ValueChanged event of every slider and set AutoPostBack="true". Then, in the server handler for the ValueChanged event, you can execute your logic that updates the database.

Regards,
Tsvetie
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
sadeghhp
Top achievements
Rank 1
answered on 29 Apr 2009, 06:37 AM
tnx for answer
but its look a simple difrnce!
when u read data from a table and by asp.net Repeater repeat and create each item on page , the server sire ValueChanged dosnt work !
in a reapeater themplate :

<asp:Repeater ID="Repeater1" runat="server">  
  <ItemTemplate> 
    <telerik:RadSlider ID="RadSlider1" runat="server" Height="20px" Width="200px" Value='<%# Bind("Value") %>'>  
    </telerik:RadSlider> 
  </ItemTemplate> 
</asp:Repeater> 
0
Tsvetie
Telerik team
answered on 01 May 2009, 11:28 AM
Hello sadeghhp,
Could you please explain in detail what you mean by saying that the server event of the RadSlider does not work? Do you get an error, does the RadSlider not postback the page or does your code in the server handler not get executed?

I created a simple test page, based on the code fragment you posted, but the server event of the RadSlider controls did fire and the code that I put in that handler did get executed. I have attached my test page for your reference. As you have not specified which version of the suite you use, I tested with the latest - 2009.1.402.

In case you still have problems with the server event of the RadSlider, please prepare and send us a simple running project, demonstrating the problem. Please note that as you cannot attach files in the forums, you have to open a new support ticket in order to send us the project.

Best wishes,
Tsvetie
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
sadeghhp
Top achievements
Rank 1
answered on 02 May 2009, 07:24 AM
Perfect!
tnx
0
Priya
Top achievements
Rank 1
answered on 08 Aug 2012, 05:46 AM
this reply very useful to me but through this msg properly but that radslider control how to move it properly....pls help me
0
Slav
Telerik team
answered on 10 Aug 2012, 10:59 AM
Hello Priya,

Your problem is not clear to me based on the provided information. Please describe your scenario and what you are trying to achieve in detail so that I can help you accordingly.

Greetings,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Priya
Top achievements
Rank 1
answered on 13 Aug 2012, 11:34 AM
hi,

  telerik using radslider control properly visible and worked in IE browser but not  visible  proper and not work in chrome and firefox.
how to aviod this problem please help me...
0
Niko
Telerik team
answered on 15 Aug 2012, 12:51 PM
Hello Priya,

In order for us to be able to investigate the issues that you are experiencing, it requires that you provide more information and details on the problem that you are experiencing. The best option is to create a sample project that isolates the issue in a simple scenario - http://blogs.telerik.com/aspnet-ajax/posts/10-09-29/isolating-a-problem-in-a-sample-project.aspx. Furthermore it would be helpful if you let us know the version of the controls that you are using.

My advice is to open a support ticket and attach the sample project there so that we can investigate it in details and be able to come up with a solution.

All the best,
Niko
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Slider
Asked by
John Reid
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
sadeghhp
Top achievements
Rank 1
Priya
Top achievements
Rank 1
Slav
Telerik team
Niko
Telerik team
Share this question
or