Creating a Scrollable Grid
To enable vertical and horizontal scrolling in a C1GridView control, select the C1GridView control and set the ScrollSettings.ScrollMode property to ScrollBar and set the ScrollSettings.ScrollOrientation property.
For example, use the following code:
' Set the grid's height and width.
C1GridView1.Height = 250
C1GridView1.Width = 450
' Turn scrolling on.
C1GridView1.ScrollSettings.ScrollMode = C1.Web.UI.Controls.C1GridView.C1GirdViewScrollMode.ScrollBar
' Set both horizontal and vertical scrolling.
C1GridView1.ScrollSettings.ScrollOrientation = C1.Web.UI.DOMScrollOrientation.Both
• C#
// Set the grid's height and width.
C1GridView1.Height = 250;
C1GridView1.Width = 450;
// Turn scrolling on.
C1GridView1.ScrollSettings.ScrollMode = C1.Web.UI.Controls.C1GridView.C1GridView.ScrollMode.ScrollBar;
// Set both horizontal and vertical scrolling.
C1GridView1.ScrollSettings.ScrollOrientation = C1.Web.UI.DOMScrollOrientation.Both;
The grid will have both horizontal and vertical scrollbars. Note that the Height and Width properties must be specified in order for the scrollbars to appear and scroll properly.
Sample Project Available
For the complete sample, see the Scrollable sample located on the ComponentOne HelpCentral Sample page.
|