Pinning single column
Columns in RadGridView can be pinned which will result in the pinned columns being anchored to the left or right side of the grid.
To pin a particular column, set its IsPinned property of the Columns collection item to
True. This will pin the column to the left size of RadGridView. In order to change the position where the
column should be pinned you have to use the PinPosition property of the particular column and choose a value
from the provided enumeration. The code block below shows pinning the third column (called “FirstName) in the RadGridView:
Copy[C#] Pinning a single columns
radGridView1.Columns[2].IsPinned = true;
radGridView1.Columns["FirstName"].IsPinned = true;
Copy[VB.NET] Pinning a single columns
Me.RadGridView1.Columns(2).IsPinned = True
Me.RadGridView1.Columns("FirstName").IsPinned = True
In order to pin the column to the right side of RadGridView consider the following code snippet:
Pinning multiple columns
Multiple column pinning is also possible. Simply set either the IsPinned property or the
PinPosition property for all columns that you want to pin:
Copy[C#] Pinning multiple columns
radGridView1.Columns["Photo"].PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.Left;
radGridView1.Columns["FirstName"].PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.Left;
radGridView1.Columns["LastName"].PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.Left;
Copy[VB.NET] Pinning multiple columns
Me.RadGridView1.Columns("Photo").PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.Left
Me.RadGridView1.Columns("FirstName").PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.Left
Me.RadGridView1.Columns("LastName").PinPosition = Telerik.WinControls.UI.PinnedColumnPosition.Left Note |
|---|
All pinned columns appear in the selected pinned section ordered by their original column index in the Columns collection.
After pinning multiple columns you can drag each of them to the desired position in the pin section.
|