0% found this document useful (0 votes)
485 views19 pages

VB Flex Grid

The Flex Grid Control allows displaying tabular data in a spreadsheet-like grid. It has more properties, events, and methods than the standard grid control, making it more powerful and flexible. Key features include displaying cells in rows and columns, formatting cells, including fonts and colors, sorting data, and handling events like clicking or scrolling. The Flex Grid Control facilitates building dynamic, interactive tables of information.

Uploaded by

Rasumathi S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
485 views19 pages

VB Flex Grid

The Flex Grid Control allows displaying tabular data in a spreadsheet-like grid. It has more properties, events, and methods than the standard grid control, making it more powerful and flexible. Key features include displaying cells in rows and columns, formatting cells, including fonts and colors, sorting data, and handling events like clicking or scrolling. The Flex Grid Control facilitates building dynamic, interactive tables of information.

Uploaded by

Rasumathi S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Flex Grid Control

 Pjt- Components-MsFlexGrid Control 6.0


(yellow color box will appear).
More powerful than grid control.
Has 80 properties, 20 events, 10 methods.
It lets to build spread sheet- like feature.
It helps to display tabular information neatly
& efficiently.
It works faster.
It displays a rectangular grid of rows &
columns .
Number of rows & columns depends on how
much we set at the design time.
Intersection of rows & columns is called cell.
Cells can hold text, bitmaps or icons(images).
It has build-in word wrap. It can be activated
through code or by properties window.
The user can move from cell-cell using arrow
keys or by mouse.
 User moves around the grid, VB
keep track of current cell as the
values of rows & column properties.
User can work with group of cells
called regions.
GENERAL PROPERTIES OF FLEXGRID
CONTROL
 Height, width properties tell how large the
grid appears.
Scroll bars can also be set
1- horizontal
2- vertical
3-both
 Cell font bold, Cell font italic, cell back
color, Cell fore color properties affect the text
or color of the current cell.
1.Cols,Rows:
• These properties determines the number of rows
& columns in the grid.
• Default 2
Syntax
GridName. Cols= Numofcols%
GridName .Rows=Numofrows%
2.Cols,Rows:
• These properties return the rows & column for the
current selected cell inside the grid.
• It is available only at run time.
3. Col position, row position
 Occasionally useful.
We can move whole rows & columns around
the grid.
Syntax
Grid Name. colposition(number) [=value]
Grid Name. rowposition(number) [=value]
4. Col Width, Row Height
 These 2 properties specifies the width of a
specified column or height of specified row.
They can be set only by code.
Syntax
Grid Name. colwidth(colnumber%) = width%
Grid Name. rowheight(rownumber%) = height%
5.Text, Text matrix
The text property returns the text inside
the current cell with 4 rows & 4 columns.
We make the cell in the bottom right
corner of the current cell.
Syntax
Text martix(rowindex, colindex)= [string]
6. Cell Left, Cell Width, Cell Top, Cell
Height
7. Col Alignment
0- left justify
1- right
2-center
Syntax
Grid Name. col Alignment(Index%) =
setting%
8. Fixed cols, Fixed Rows & Fixed Alignment
• When working with grids, we often want certain
cells to display information all the times.
• Eg: column headings.
• Fixed rows & columns are always displayed in
gray & must be at the top & left sides of the grid.
• By default we will have one fixed rows &
columns.
• Fixed alignment works exactly like coumn
alignment property, but applies only to fixed
columns.
Syntax
Grid Name. fixed col= number of fixed cols%
Grid Name. fixed row = number of fixed cols%
Grid Name. fixed Alignment = setting number %

9. Grid lines , scroll bars


• These 2 properties control gridlines & scrol bar
appearance.
• Default- is to show grid line & to have both
horizontal & vertical scroll bars.
10. Left col, Top row
• These 2 properties controls the left most
column & top row displayed from a grid.
• They can be set only by code.
Syntax
Grid Name. left col= left most col%
Grid Name. top row= height row%
PROPERTIES OF SELECTED CELLS INSIDE
THE GRIDS
1. Col sel, Row sel:
These properties work with row & col properties
to determine the size of the current selection.

2. Clip:
This property returns the contents of the selected
region.
Syntax
Grid Name. clip=string$
3. Fill style
 User enter into one cell of the selected
region to fill up the entire region.
Default-0, 1- flex fill repeat.

4. High light
 It has 3 values
0- flex high light never
1- flex high light always
2- flex high light with focus
5. Allow Big Selection
• True/False property determines clicking on rows
& column header selects the entire row or column.
6. Allow user resizing
• It determines whether the user can resize a row or
column at run time using mouse.
0-default
1-column resize
2- row resize
3-both
Sorting a grid
• Most powerful feature of flex grid .
• It has got the ability to sort rows according to the
column selected.
Syntax
Flex Grid Name. sort=value

Value 0-none
1- Ascending order
2-Descending order
3-Ascending but converts string to numbers
4- Descending but converts string to
numbers.
5-Ascending but case insensitive
6- Descending but case insensitive
7-Ascending but case sensitive
8- Descending but case sensitive
9- Use the compare events to compare
rows
EVENTS AND METHODS FOR FLEX
GRID
Grids respond to many of the std. events
Eg: Click event
key press event
Methods for resizing a grid
• There are also methods to insert or delete rows
from a grid.
Syntax
Grid Name. add item item$[,index%]

Remove item:
It removes a row from a grid
Syntax
Grid Name. remove item index%

You might also like