ComponentOne GridView for ASP.NET AJAX: GridView for ASP.NET AJAX Task-Based Help > Using Client-Side Scrolling > Creating a Non-Scrollable Column

Creating a Non-Scrollable Column

You can lock a column to prevent it from scrolling by setting the column's Fixed property to True. The following example fixes the first column in the grid so that it will not scroll.

In the Designer

Complete the following steps:

1.   Create a scrollable grid. For an example, see Creating a Scrollable Grid.

2.   Click the C1GridView Smart Tag and select Property builder from the C1GridView Tasks menu.

3.   In the C1GridView Properties dialog box, click the Columns tab and choose a column from the list of Selected columns, for example choose the first column.

4.   Set the column's Fixed property to True.

5.   Click OK to save your setting and close the C1GridView Properties dialog box.

In Source View

Complete the following steps:

1.   Create a scrollable grid. For an example, see Creating a Scrollable Grid.

2.   Switch to Source view.

3.   Set the first column's Fixed property to True by adding Fixed="True" to the <cc1:C1BoundField> tag, so it appears similar to the following:

<cc1:C1BoundField DataField="ProductName" HeaderText="Product" SortExpression="ProductName" Fixed="True">

This keeps the column fixed to the left side of the grid when it is scrolled horizontally.

In Code

Complete the following steps:

1.   Create a scrollable grid. For an example, see Creating a Scrollable Grid.

2.   Set the first column's Fixed property to True. This keeps the column fixed to the left side of the grid when it is scrolled horizontally.

      Visual Basic

C1Grid1View.Columns(0).Fixed = True

      C#

C1GridView1.Columns[0].Fixed = true;

 What You've Accomplished

Run your application and scroll the grid. Note that the column does not scroll to the right with the other columns.

* Sample Project Available

For the complete sample, see the Scrollable sample located on the ComponentOne HelpCentral Sample page.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.