comp • gb.qt4 • gridview

GridView (gb.qt4)

Implements a control that displays data in a grid.

You can fill the grid explicitly, or implement the Data event to display the grid contents on demand.

You should use the last method if you have a lot of rows to display. The control can handle millions of lines gracefully.

This class inherits UserControl.
This class is
Create a new gridview.
creatable
.
This class acts like a
Return a cell from its row and its column.
read-only
array.

Constants

Indicate that both horizontal and vertical headers must be displayed.
Both  
Indicate that the horizontal header must be displayed.
Horizontal  
Indicate that no header is displayed.
None  
Indicate that the vertical header must be displayed.
Vertical  

Properties

Methods Events
Returns or sets the action string associated with the control.
Action  
Return or set if the last column will automatically be resized so that the gridview view area is entirely covered.
AutoResize  
Returns or sets the background color used by the control.
Background  
Return or set if the control displays a border.
Border  
Returns a collection of each control included in the container.
Children  
A synonymous for the ClientHeight property.
ClientH  
Return the height of the internal area containing the cells.
ClientHeight  
A synonymous for the ClientWidth property.
ClientW  
Return the width of the internal area containing the cells.
ClientWidth  
Return the left position of the internal area containing the cells.
ClientX  
Return the top position of the internal area containing the cells.
ClientY  
Return or set the index of the current column.
Column  
Return a virtual array of each gridview column.
Columns  
Return the current cell.
Current  
Use this property for assigning a custom cursor to a control.
Cursor  
Use this property to store the contents of a cell during the Data event handler.
Data  
Indicates that the control is in design mode.
Design  
Returns or sets if a control accepts drops.
Drop  
Indicates that the control is enabled.
Enabled  
Returns or sets if a control will expand if included in a container that arranges its contents.
Expand  
Returns or sets the font used to draw text in the control.
Font  
Returns or sets the foreground color used by the control.
Foreground  
Return or set if the grid is displayed.
Grid  
A synonymous for the Height property.
H  
Returns the internal X11 window handle of the control.
Handle  
Returns whether the control has the focus.
HasFocus  
Return or set which headers should be displayed:
Header  
Returns or sets the height of the control.
Height  
Returns whether the mouse cursor is inside the control.
Hovered  
A synonymous for the Handle property.
Id  
Returns or sets if a control must be ignored when its parent arranges its children.
Ignore  
Returns or sets the position of the left border of the control relative to its parent.
Left  
Return or set the selection mode:
Mode  
Returns or sets the appearence of the cursor when it points inside the control.
Mouse  
Returns or sets the name of the control.
Name  
Returns the next control having the same parent.
Next  
Return or set if a control cannot be focused with the TAB key.
NoTabFocus  
Return or set the default cell padding in pixels.
Padding  
Returns the control container.
Parent  
Return or set the name of the menu that will be popped-up when the user presses the right mouse button or the keyboard MENU key.
PopupMenu  
Returns the previous control having the same parent.
Previous  
Return or set the "proxy" of a control.
Proxy  
Return or set if the column headers are resizable.
Resizable  
Return or set the index of the current row.
Row  
Return a virtual array of each gridview row.
Rows  
Returns the position of the left border of the control in screen coordinates.
ScreenX  
Returns the position of the top border of the control in screen coordinates.
ScreenY  
Return or set which scrollbars are displayed.
ScrollBar  
A synonymous for ScrollHeight.
ScrollH  
Returns the contents height.
ScrollHeight  
A synonymous for ScrollWidth.
ScrollW  
Returns the contents width.
ScrollWidth  
Returns or sets the horizontal scrolling position.
ScrollX  
Returns or sets the vertical scrolling position.
ScrollY  
Return or set if a light cursor is drawn around the current cell.
ShowCursor  
Return or set if clicking on a column header toggles the sort indicator.
Sorted  
Returns or sets the control tag.
Tag  
Returns or sets the tooltip shown when the mouse stays on the control a few time.
Tooltip  
Returns or sets the position of the top border of the control relative to its parent.
Top  
Returns or sets if the control will receive MouseMove events.
Tracking  
Indicates if the control is visible or not.
Visible  
A synonymous for the Width property.
W  
Returns or sets the width of the control.
Width  
Returns the top-level window that contains the control.
Window  
Returns or sets the position of the left border of the control relative to its parent.
X  
Returns or sets the position of the top border of the control relative to its parent.
Y  
AddColumn  
Clear the grid static contents.
Clear  
Return the index of the column pointed by the specified horizontal position.
ColumnAt  
Destroys the control.
Delete  
Starts a drag & drop process.
Drag  
Finds the first child control pointed by the X and Y coordinates.
FindChild  
Grab the keyboard and the mouse so that all keyboard and mouse events are received by the control.
Grab  
Hides the control.
Hide  
Sends the control to the background of its parent.
Lower  
Moves and/or resizes the control.
Move  
Moves and/or resizes the control.
MoveScaled  
Set the current cell row and column.
MoveTo  
Sends the control to the foreground of its parent.
Raise  
Trigger a redraw of the control.
Refresh  
Changes the container of a control.
Reparent  
Resizes the control.
Resize  
Resizes the control.
ResizeScaled  
Return the index of the row pointed by the specified vertical position.
RowAt  
Scroll the contents to the given position.
Scroll  
Selects several rows.
Select  
Select all rows.
SelectAll  
Gives the focus to the control.
SetFocus  
Shows the control.
Show  
Unselect all rows.
UnSelectAll  
Raised when the user double-clicks on a cell.
Activate  
This event is raised when a container has just finished arranging its contents.
Arrange  
This event is raised just before a container arranges its contents.
BeforeArrange  
Raised when the current cell has changed.
Change  
Raised when the user clicks on a cell.
Click  
Raised when the user clicks on a column header.
ColumnClick  
Raised when a column is resized.
ColumnResize  
Raised when a specific column has been resized.
ColumnSize  
This event is raised when the data stored in the specified cell is needed (usually to draw it).
Data  
Raised when the user quickly clicks twice on the control.
DblClick  
This event is raised when the mouse enters the control during a drag & drop process.
Drag  
This event is raised when the mouse leaves the control during a drag & drop operation.
DragLeave  
This event is raised while the mouse moves inside the control during a drag & drop process.
DragMove  
Raised when a cell must be drawn.
Draw  
This event is raised when a drag is dropped in the control.
Drop  
Raised when the mouse enters the control.
Enter  
Raised when the control has got the focus.
GotFocus  
Raised when a key is pressed while the control has the focus.
KeyPress  
Raised when a key is released while the control has the focus.
KeyRelease  
Raised when the mouse leaves the control.
Leave  
Raised when the control has lost the focus.
LostFocus  
Raised when the user clicks on the control with the right mouse button, or if it hits the MENU key.
Menu  
Raised when a mouse button is pressed while the cursor is inside the control.
MouseDown  
This event is raised when a drag operation should be started.
MouseDrag  
Raised when the mouse moves inside the control while a mouse button is pressed.
MouseMove  
Raised when a mouse button is depressed while the cursor is inside the control.
MouseUp  
This event is raised when the user moves or presses the mouse wheel while the mouse is inside the control.
MouseWheel  
This event is raised when a new child Control has just been inserted into the container.
NewChild  
Raised when the user clicks on a row header.
RowClick  
Raised when a row is resized.
RowResize  
Raised when a specific row has been resized.
RowSize  
Raised when the control contents have been scrolled.
Scroll  
Raised when the selection changes.
Select  
Raised when the GridView contents must be sorted.
Sort  

Example

'Fill grid explicitely
GridView1.Columns.Count = 4
GridView1.Rows.Count = 3
GridView1.Columns.Width = 52
GridView1.Rows[1].Height = 52
GridView1[0, 0].Text = "0,0"
GridView1[0, 0].Alignment = Align.Right
GridView1[1, 1].Text = "1,1"
GridView1[0, 1].Text = "0,1"
GridView1[1, 0].Picture = Picture["image.png"]