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

[Solved] Replace Scrollbar with RadSlider

4 Answers 152 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas Salt
Top achievements
Rank 1
Thomas Salt asked on 29 May 2008, 04:43 PM
Is it possible to replace the scrollbars in the rad grid with the RadSlider or use the RadSlider to scroll the grid?

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 May 2008, 06:02 AM
Hi,

Go through the following code library link.
Virtual RadGrid paging using RadSlider and RadAjax

Shinu
0
Vlad
Telerik team
answered on 30 May 2008, 06:18 AM
Hello Thomas,

I have attached small example.

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Thomas Salt
Top achievements
Rank 1
answered on 30 May 2008, 01:19 PM

Hi Shinu and Vlad,

Shinu - the link you sent was actually for grid paging.  I was looking to replace the scrolls bars.

Vlad - I keep getting the following error.
"the controls collection cannot be modified because the control contains code blocks"

This only occurs when i put the following javascript on the page and if I have a RadAjaxManager on the page.  If I remove the RadAjaxManager I no longer get this error.   I have put the stack trace below the javascript in hopes that it may help.

Any Ideas?

<script type="text/javascript">  
      
        function pageLoad(sender, args)  
        {  
            $find("<%= RadSlider1.ClientID %>").set_maximumValue($find("<%= RadGrid1.ClientID %>")._gridDataDiv.scrollWidth);  
            $find("<%= RadSlider2.ClientID %>").set_maximumValue($find("<%= RadGrid1.ClientID %>")._gridDataDiv.scrollHeight);  
        }  
      
        function valueChange(sender, args)  
        {  
            var gridDataDiv = $find("<%= RadGrid1.ClientID %>")._gridDataDiv;  
            if(sender.get_id() == "<%= RadSlider1.ClientID %>")  
            {  
                gridDataDiv.scrollLeft = sender.get_value();  
            }  
            else 
            {  
                gridDataDiv.scrollTop = sender.get_value();  
            }  
        }  
    </script>  
 

 
[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]  
   System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +375  
   Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +110  
   Telerik.Web.UI.RadAjaxControl.PerformRender() +418  
   Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) +1223  
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +87  
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +98  
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21  
   System.Web.UI.Page.Render(HtmlTextWriter writer) +27  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +280  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24  
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7422 
0
Konstantin Petkov
Telerik team
answered on 30 May 2008, 02:58 PM
Hello Thomas Salt,

Please, wrap the script into a RadCodeBlock control and let us know if you need further assistance.

Best wishes,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Thomas Salt
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Vlad
Telerik team
Thomas Salt
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Share this question
or