Static Headers
The most common problem when scrolling is losing the context of the current column, i.e. its header name. Telerik RadGrid lets you keep the header at the top even when scrolling the grid. You just need to set the UseStaticHeaders property to true. Its default value is false.
|
|
|
|
UseStaticHeaders =true Even when the grid is scrolled, the header row is still visible. |
UseStaticHeaders =false
The grid is scrolled and the header is scrolled as well (disappears). |
 |
Note that when you use scrolling with static headers, Telerik RadGrid columns should declare HeaderStyle.Width. |
Here is an example for setting the scrolling-related properties:
| ASPX/ASCX |
Copy Code |
|
// declaration <rad:RadGrid runat="server" ... /> <ClientSettings> <Scrolling AllowScroll="True" UseStaticHeaders="true"> |
| C# |
Copy Code |
|
// code ... RadGrid RadGrid1 = new RadGrid(); RadGrid1.ClientSettings.Scrolling.AllowScroll = true;RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = true; ... |
| VB.NET |
Copy Code |
|
... Dim RadGrid1 as = new RadGrid() RadGrid1.ClientSettings.Scrolling.AllowScroll = trueRadGrid1.ClientSettings.Scrolling.UseStaticHeaders = true ...
|
Using Static Headers and Percent Sizes
Telerik RadGrid allows you to use static headers even when it is set to 100% width and 100% height. You will see only the grid scrollbars. The browser scrollbars will be hidden. Thus Telerik RadGrid can mimic Microsoft Excell application.