The image below shows a VGridControl control with the Bands view layout applied to it.

The features specific to this layout are listed below:
- A single record (or part of one) is displayed at a time. End-users can navigate through the records using the horizontal scroll bar. (You can provide your users with a custom method of scrolling through records. See the Focus and Scroll Records topic for details.)
- The control's contents cannot be scrolled vertically. The row header cells and data cells are arranged into a number of columns that won't exceed the grid's height. These columns are bands.
- Bands can either exceed the control's width (requiring scrolling to view all the bands) or be adjusted to fit the control's width. See Scrolling Bands below for more information.
- end-users can resize bands by dragging the right border of the leftmost visible band.
The following list enumerates properties specific to this layout.
If the grid's BaseOptionsView.AutoScaleBands property is set to true, bands will be resized (stretched or shrunk as appropriate) to exactly occupy the grid's entire client region. Otherwise, if the total width of the bands exceeds that of the grid's client region and the grid's BaseOptionsView.AutoScaleBands property is set to false some of the bands will be outside the visible area.
If a band is partially visible, end-users can make it completely visible by clicking its data cells or by scrolling through the bands using the mouse wheel if the VGridOptionsBehavior.RecordsMouseWheel property is set to false. This property can be accessed via the grid's VGridControlBase.OptionsBehavior property.
The following sample code demonstrates how to scroll bands via code. The VGridControlBase.LeftVisibleBand property is used for this purpose. It's assumed that there are two buttons in your application: 'btnForward' and 'btnBackward'. These buttons scroll the bands forward and backwards, respectively. When the first or last band is reached the corresponding button is disabled. The handlers for the button clicks are listed below.
C# |
private void btnBackward_Click(object sender, System.EventArgs e) {
vGridControl1.LeftVisibleBand -= 1;
if (vGridControl1.LeftVisibleBand == 0)
btnBackward.Enabled = false;
btnForward.Enabled = true;
}
private void btnForward_Click(object sender, System.EventArgs e) {
vGridControl1.LeftVisibleBand += 1;
if (vGridControl1.LeftVisibleBand == vGridControl1.BandCount - 1)
btnForward.Enabled = false;
btnBackward.Enabled = true;
}
|
VB |
Private Sub btnBackward_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackward.Click
VGridControl1.LeftVisibleBand = VGridControl1.LeftVisibleBand - 1
If VGridControl1.LeftVisibleBand = 0 Then
btnBackward.Enabled = False
End If
btnForward.Enabled = True
End Sub
Private Sub btnForward_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnForward.Click
VGridControl1.LeftVisibleBand = VGridControl1.LeftVisibleBand + 1
If VGridControl1.LeftVisibleBand = VGridControl1.BandCount - 1 Then
btnForward.Enabled = False
End If
btnBackward.Enabled = True
End Sub
|