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

asp GridView(s) in rotator

4 Answers 80 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Aarsh
Top achievements
Rank 1
Aarsh asked on 13 Nov 2012, 11:15 PM
I am using custom controls (containing grid 1 view) as the rotator items, and want to reuse the same control with different tables (fyi - the control itself has no problems, there are no other controls in the custom control but SQL data-source)

Now -
  1. I do not want to let the frames cut off
  2. I want to display one frame at a time (and so I want the 1st item)
  3. Is there any way out to replicate the exact behavior as this (https://www.dreamspark.com/Student/Software-Catalog.aspx) page's "Developer & Designer Tools" and "Servers & Applications" section ? (I would love to have the horizontal scroll-bar !)
  4. As I am having gridviews in the frame, I want to persist rotator's index after sorting

I tried to set the item width equal to the rotator's "Window" size, and said false to wrapping but still they sit one UNDER another (I have two "frames" of my custom user control )

4 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 16 Nov 2012, 04:05 PM
Hello Aarsh,

As suggested in this help article if you want to achieve smooth items sliding you should ensure that the size of the RadRotator's view port can fit the number of items you want to display at a time. If the properties Width, Height, ItemWidth and ItemHeight are set according to the instructions in the help article and the problem persists, most probably there are global CSS styles that are modifying the size of the rotator items or adding padding/margin thus breaking the correct behavior of the rotator. Please check if there are such styles and try removing them from your page.

If you want to display only one frame at a time the value of Width should be equal to ItemWidth and Height should be equal to ItemHeight.

The online demo Slider / Custom Scrollbar will be useful for implementing the behavior from the page you linked.

You can handle the server-side event OnItemClick of RadRotator to maintain the control's current index. Check the linked article for an example.


All the best,
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
Aarsh
Top achievements
Rank 1
answered on 29 Nov 2012, 02:33 PM
Thanks Slav. I saw the demo of custom slider and it is stunning. Two thing I would like to mention -
  1. The demo seems to be using http://demos.telerik.com/aspnet-ajax/slider/examples/customscrollbar/Images/Boxes.jpg image meditatively, where as I am more interested to do something in the grid-view.
  2. I already have my custom user control (controlling a grid-view and its data-source) ready and running on the page. I just need to figure out the way to "add" them in to the slider window. 
<telerik:RadSlider ID="showcaseSlider" runat="server" Orientation="Horizontal" SmallChange="1" Width="100%" Value="0" >
                <Items>
                    <telerik:RadSliderItem />
                </Items>
Or...
                <ItemBinding />
            </telerik:RadSlider>

Slav, I tried to use the example mostly as is with having my custom user control (as mentioned in the paragraph above in this post) instead the images ... and I got something Like This...
0
Slav
Telerik team
answered on 04 Dec 2012, 08:44 AM
Hello Aarsh,

If I understand your scenario correctly, you want to replace the images from the online demo with GridView controls and you have problems positioning them horizontally.

For your convenience I have prepared a sample page that shows a possible solution for this problem. The setup is similar to the one in the demo. The grid views are placed in the div element with ID boxes_content and each of them is wrapped in a div element so that they can be aligned horizontally via CSS. Also, adding items to the RadSlider is not required in this case.

Please use the attached sample as a reference for your further development. 

Regards,
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
Aarsh
Top achievements
Rank 1
answered on 11 Dec 2012, 08:10 PM
Thank you so much Slav, I really appreciate it. I ended up using this scenario.
Tags
Rotator
Asked by
Aarsh
Top achievements
Rank 1
Answers by
Slav
Telerik team
Aarsh
Top achievements
Rank 1
Share this question
or