You can use the StaticRowIndex or StaticColumnIndex to freeze a row/column in order to prevent it from scrolling. An integer value to determine the row/column number to be frozen is set in this property.
The following example fixes the first row in the grid so that it will not scroll.
In the Designer
Complete the following steps:
In Source View
Complete the following steps:
<cc1:C1GridView ID="C1GridView1" runat="server" StaticRowIndex='0'>
This keeps the first row fixed when the grid is scrolled vertically.
In Code
Complete the following steps:
To write the code in Visual Basic:
Visual Basic |
Copy Code
|
---|---|
' Fix the top row of the grid when scrolling vertically.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
To write the code in C#:
C# |
Copy Code
|
---|---|
// Fix the top row of the grid when scrolling vertically. protected void Page_Load(object sender, EventArgs e) {> C1GridView1.StaticRowIndex = 0; >} |
Run your application and scroll the grid. Note that the first row does not scroll with the other rows of the grid.
Follow the same process using the StaticColumnIndex property to create non-scrollable columns.