Slider in a repeater

11 posts, 0 answers
  1. John Reid
    John Reid avatar
    28 posts
    Member since:
    Mar 2006

    Posted 26 Jan 2009 Link to this post

    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?
  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 29 Jan 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. sadeghhp
    sadeghhp avatar
    15 posts
    Member since:
    Feb 2007

    Posted 20 Apr 2009 Link to this post

    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
  5. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 22 Apr 2009 Link to this post

    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.
  6. sadeghhp
    sadeghhp avatar
    15 posts
    Member since:
    Feb 2007

    Posted 29 Apr 2009 Link to this post

    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> 
  7. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 01 May 2009 Link to this post

    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.
  8. sadeghhp
    sadeghhp avatar
    15 posts
    Member since:
    Feb 2007

    Posted 02 May 2009 Link to this post

    Perfect!
    tnx
  9. Priya
    Priya avatar
    3 posts
    Member since:
    Jun 2012

    Posted 08 Aug 2012 Link to this post

    this reply very useful to me but through this msg properly but that radslider control how to move it properly....pls help me
  10. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 10 Aug 2012 Link to this post

    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.
  11. Priya
    Priya avatar
    3 posts
    Member since:
    Jun 2012

    Posted 13 Aug 2012 Link to this post

    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...
  12. Niko
    Admin
    Niko avatar
    387 posts

    Posted 15 Aug 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017