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

Unwanted space on enable scrolling

3 Answers 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jebamalai
Top achievements
Rank 1
Jebamalai asked on 29 Sep 2008, 09:33 AM
Dear All,

When I enable scrolling, it is including too much unwanted space between the rows and the status bar / pager.

Can any one tell me why this happens and how to rectify it?

Thanks a lot in advance.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Sep 2008, 10:13 AM
Hello Jebamalai,

Have you tried setting the scroll height accordingly? If not try, setting it as shown below and see if it helps...
aspx:
<ClientSettings> 
    <Scrolling AllowScroll="true" ScrollHeight="200" /> 
</ClientSettings> 
 

Thanks
Princy.
0
Jebamalai
Top achievements
Rank 1
answered on 29 Sep 2008, 10:48 AM
Dear Princy,

Thank you for your valuable and timely reply.

Actually the space remains blank when the no of items in the grid is very less.

This we have to do it in code?

I have one more clarification.

The header has to remain fixed while scrolling.

How this can be done?

Kindly let me know it.

Thanks a lot in advance.
0
Accepted
Shinu
Top achievements
Rank 2
answered on 29 Sep 2008, 12:32 PM
Hello Jebamalai,

You can check for the items count and set the ScrollHeight accordingly in the code behind as given below. Also for the headers to remain fixed set the UseStaticHeaders property o true.
aspx:
<ClientSettings> 
      <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
</ClientSettings> 

cs:
 protected void RadGrid1_PreRender(object sender, EventArgs e)  
    {  
        if (RadGrid1.MasterTableView.Items.Count <= 3)  
        {  
            RadGrid1.ClientSettings.Scrolling.ScrollHeight = Unit.Pixel(100);  
        }  
        else  
        {  
            RadGrid1.ClientSettings.Scrolling.ScrollHeight = Unit.Pixel(200);  
        }  
    } 
 
Thanks
Shinu.
Tags
Grid
Asked by
Jebamalai
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jebamalai
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or