grid takes time to come in its original size

5 posts, 0 answers
  1. Vimal Kumar
    Vimal Kumar avatar
    43 posts
    Member since:
    Dec 2008

    Posted 31 Mar 2009 Link to this post

    Hi There,

    I am working on telerik. In which i have facilitate with virtual loading. And I am having nearly 800 data. I have given the page size as 35. I fell when ever the grid is getting load first time grid is showing with 9 data, but in one second the grid will come in its original size. I want when the grid get load first time, that time itself it should load in original size. Let me know whether this is possible or not. Can anybody help me on this....???

    Regards:
    Vimal Kumar Srivastava
    Madhepura, Bihar
    Email Id: vimaltech04@gmail.com
     
  2. Dimo
    Admin
    Dimo avatar
    8332 posts

    Posted 31 Mar 2009 Link to this post

    Hi Vimal Kumar,

    I suppose that you have enabled scrolling with static headers. If this is the case, please set ScrollHeight in ClientSettings > Scrolling and remove the RadGrid Height, if you have one.

    Best wishes,
    Dimo
    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. Vimal Kumar
    Vimal Kumar avatar
    43 posts
    Member since:
    Dec 2008

    Posted 01 Apr 2009 Link to this post

    Hi Dimo,

    Thanks for your reply. But i don't want to set the static scroll height, as i use to check it in all resolution. So, Is there any way to set the scroll height in javascript. The javaScript i am using is below, Can u please recode it:

    <script type="text/javascript">         
            window.onresize = GridCreated
            var browser=navigator.appName;                  // Get Browser Name 
            var b_full_version=navigator.appVersion;        // Get Browser Details 
            var b_version=parseFloat(b_full_version);       // Get Browser version 
            var func; 
            var scrollArea,  
                h = 0
                w = 0
                gwidth = 80+40+100+35+70+70+70+250+75+70+90+90+90+75+90+90; 
             
            //resize the window 
            function GridCreated() 
            { 
                //Check the window height and set the window width and height 
                if(!(document.documentElement.clientWidth == 0)) 
                { 
                    w = document.documentElement.clientWidth; 
                    h = document.documentElement.clientHeight; 
                }             
                else 
                { 
                    w = document.body.clientWidth; 
                    h = document.body.clientHeight; 
                } 
                 
                //Get Grid Object 
                grid = document.getElementById('<%=rgIssueList.ClientID %>'); 
                //Get Scroll Area 
                scrollArea = document.getElementById("<%= rgIssueList.ClientID %>" + "_GridData"); 
                //Get grid data height 
                var dataHeight =  document.getElementById("ctl00_ContentPlaceHolder1_rgIssueList_ctl00"); 
                 
                if(browser=="Microsoft Internet Explorer") 
                { 
                    //set grid height 
                    if(h-335 > 20) 
                    { 
                        //Check the grid row is less than 15  
                        if(dataHeight.clientHeight < 200
                        { 
                            //alert("vimal"); 
                            scrollArea.style.height = dataHeight.clientHeight + 10 + "px"; 
                            scrollArea.style.overflow = "auto"
                        } 
                        else 
                        { 
                            if(h > 800 && dataHeight.clientHeight < 700
                            {   
                                scrollArea.style.height = dataHeight.clientHeight + "px"; 
                                scrollArea.style.overflow = "auto"
                            } 
                            else 
                            { 
                                scrollArea.style.height = (h - 320) + "px"; 
                                scrollArea.style.overflow = "auto"
                            } 
                        } 
                    } 
                     
                    //set grid width 
                    if(w-540 > 100) 
                    {   
                        if(w > gwidth ) 
                        { 
                            grid.style.width =  gwidth + 15 + "px"; 
                            grid.style.overflow = "hidden";     
                        } 
                        else 
                        { 
                            grid.style.width =  (w - 40) + "px"; 
                            grid.style.overflow = "hidden";                       
                        } 
                    } 
                    else 
                    { 
                        
                    }  
                } 
                 
                if(browser=="Netscape") 
                {   
                     //set grid height 
                     if ((screen.width<=1280) && (screen.height<=768)) 
                     { 
                        //set grid height 
                        if(h-335 > 20) 
                        { 
                            if(dataHeight.clientHeight < 100
                            { 
                                scrollArea.style.height = dataHeight.clientHeight + 20 + "px"; 
                                scrollArea.style.overflow = "auto"
                            } 
                            else 
                            { 
                                if(h > 100 && dataHeight.clientHeight < 180
                                { 
                                    scrollArea.style.height = dataHeight.clientHeight + "px"; 
                                    scrollArea.style.overflow = "auto"
                                } 
                                else 
                                { 
                                        scrollArea.style.height = (h - 300) + "px"; 
                                        scrollArea.style.overflow = "auto"
                                } 
                            } 
                         } 
                     } 
                     else 
                     { 
                        //set grid height 
                        if(h-435 > 100) 
                        { 
                            if(dataHeight.clientHeight < 180
                            { 
                                scrollArea.style.height = dataHeight.clientHeight + 20 + "px"; 
                                scrollArea.style.overflow = "auto"
                            } 
                            else 
                            { 
                                if(h > 800 && dataHeight.clientHeight < 700
                                { 
                                    scrollArea.style.height = dataHeight.clientHeight + "px"; 
                                    scrollArea.style.overflow = "auto"
                                } 
                                else 
                                { 
                                    scrollArea.style.height = (h - 400) + "px"; 
                                    scrollArea.style.overflow = "auto"
                                } 
                            } 
                         } 
                     } 
                     
                    //set grid width 
                    if(w-540 > 100) 
                    {    
                        if(w > gwidth ) 
                        { 
                                grid.style.width =  gwidth - 20 + "px"; 
                                grid.style.overflow = "hidden";  
                                
                        } 
                        else 
                        { 
                                grid.style.width =  (w - 30) + "px"; 
                                grid.style.overflow = "hidden";  
                        } 
                    } 
                } 
            } 
            </script> 
    Waiting for your reply........!!!

     Regards:
    Vimal Kumar Srivastava
    Softsmith Infotech Pvt. Ltd.
    Email Id: vimalk@softsmith.com


  5. Dimo
    Admin
    Dimo avatar
    8332 posts

    Posted 02 Apr 2009 Link to this post

    Hello Vimal,

    I am afraid that your implementation is too complicated. You can set height directly to the RadGrid scrollable area, however, the control can do the same thing automatically. So a better approach is to set height to the RadGrid <div> and call the repaint() method:

    Javascript

    var grid = $find('<%=rgIssueList.ClientID %>');
    grid.get_element().style.width =  ..... + "px";
    grid.get_element().style.height =  ..... + "px";
    grid.repaint();


    The additional Javascript size calculations are a matter of your preference.

    Greetings,
    Dimo
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. senthil
    senthil avatar
    23 posts
    Member since:
    Dec 2008

    Posted 06 Apr 2009 Link to this post

    This repaint() method works fine for height resize,but empty space is there if no data is there. Also width getting resize but not getting scroll bar.Please reply this if anybody have idea on it.

    Thanks and Regards,
    Senthil Kumar.T
    mailto:senthil153@gmail.com
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017