Data Grid - Free Grid Control
The best free grid control, you can choose any format (font name, bold, italic...) for each field and much more

Introduction
This is the best free grid control for VB 6. With this control, you can format each field (set font name, bold, italic, underline, align), it's very easy to use. Support AddRow
and AddColumn
. You can also auto add new row if you accessed to last row. Events (click, change...) give you indexes of last and new column/row. There are many properties, so you can easily create designs as per your wish (fore color, fore color selected, grid color, grid color fixed, back color, back color selected, back color fixed...).
There is also a property called RowFixedData
where you can choose what will be printed in rowname
field (its first column). You can choose between:
UserDefined
– show text defined by programmerRowNumber
– auto generate row numbers and show themSelectedPointer
– Show * at selected row
Example Codes
' Setting row / column count:
Me.ucGrid1.Cols = 5
Me.ucGrid1.Rows = 1
' Set row / column names – if first index is 0 then you change column names,
' if second index is 0 then you change row names:
Me.ucGrid1.Data(0, 1) = "ID"
Me.ucGrid1.Data(0, 2) = "Name"
Me.ucGrid1.Data(0, 3) = "Phone"
How to Use
This is a standard EXE project. If you want to add this to your project, you must copy all modules and user controls to your project directory. After that, you must add these files to your project.
If you want, you can create an ActiveX project and add this file to this project and create OCX.
Properties
AutoAddNextRow As Boolean
– ifTrue
then control will automatically add new row when you access the last rowBackColor As OLE_COLOR
– data back colorBackColorFixed As OLE_COLOR
– row / column names back colorBackColorContainer As OLE_COLOR
– user control back colorBackColorSelected As OLE_COLOR
– selected field back colorCols As Long
– number of columns, when changed all data are deletedRows As Long
– number of rows, when changed all data are deletedData(ByVal s_row As Long, ByVal s_col As Long) As String
– data in selected fieldEditable As Boolean
– ifTrue
user can edit fieldsFldAlign(ByVal mRow As Long, ByVal mCol As Long) As eAlign
– (Left, Center or Right) field text (data) alignFldFontBold(ByVal mRow As Long, ByVal mCol As Long) As Boolean
– field font boldFldFontItalic(ByVal mRow As Long, ByVal mCol As Long) As Boolean
– field font italicFldFontName(ByVal mRow As Long, ByVal mCol As Long) As String
– field font nameFldFontUnderline(ByVal mRow As Long, ByVal mCol As Long) As Boolean
– field font underlineForeColor As OLE_COLOR
– data fore colorForeColorFixed As OLE_COLOR
– row / column name fore colorForeColorSelected As OLE_COLOR
– selected field fore colorGridColor As OLE_COLOR
– grid color (where is data)GridColorFixed As OLE_COLOR
– grid color (where is row / col names)SelectedCol As Long
– return / set selected columnSelectedRow As Long
– return / set selected rowSizable As Boolean
– ifTrue
, user can change field width / height
History
- 20th October, 2007: Initial post