TcxGridTableController.LeftPos Property
Specifies the horizontal offset of the Views contents.
Declaration
property LeftPos: Integer read; write;
Property Value
Type |
---|
Integer |
Remarks
You can use the LeftPos property to scroll the current View horizontally.
When the total width of all View columns is greater than the View window and the View’s OptionsView.ScrollBars property is set to ssHorizontal or ssBoth, a horizontal scrollbar appears thus enabling scrolling.
LeftPos specifies the offset, in pixels, of the visible View part relative to the left edge of the first column.
To scroll the View vertically, see the TopRecordIndex property. The Scroll method allows you to simulate user actions with a scrollbar. Refer to its description for more information. To make a specific column visible, use the MakeItemVisible method.
The following example scrolls the View contents to make the rightmost column visible. It subtracts the ViewInfo.ScrollableAreaWidth value from ViewInfo.DataWidth thus getting the maximum offset for the LeftPos property:
var
AView: TcxGridTableView;
//...
if Grid.FocusedView is TcxGridTableView then
with TcxGridTableView(Grid.FocusedView) do
Controller.LeftPos :=
ViewInfo.DataWidth - ViewInfo.ScrollableAreaWidth;