IGrid - VB Grid Control - 10Tec
Có thể bạn quan tâm
10Tec iGrid ActiveX is a top-notch VB grid control. It is built on the Visual Basic runtime library, which makes this component a native grid control for the VB6 IDE and Visual Basic for Applications in Microsoft Office:
iGrid ActiveX is a VB grid control allowing you to access its cells like items in a 2-dimensional array. What is important, every cell of iGrid can contain a value of the VB Variant data type. This allows you to mix values of various types in the same column with no additional efforts from your side.
The usage of this grid control in VB begins with definition of the rows and columns. In the simplest case, you can specify the required numbers of columns and rows with the ColCount and RowCount properties, and iGrid will create cells on intersections of these columns and rows automatically. After that you can set cell values with the CellValue property using the array syntax:
With iGrid1 .ColCount = 5 .RowCount = 10 .CellValue(1, 1) = 100 .CellValue(2, 1) = "Some text" End WithThe code above creates a VB grid with 5 columns and 10 rows and populates the top two cells in the first column with a number and string value:
There is another way to create columns. You can define them one-by-one using the AddCol method, for example:
iGrid1.AddCol iGrid1.AddCol sHeader:="Company" iGrid1.AddCol "id", "Person ID", 125The first statement calls the AddCol method without parameters to create a column with default settings in a VB grid control named iGrid1. The next AddCol call specifies the column title text in the second created column. The last statement creates the third column and specifies the column's string key, title and width using the first 3 parameters of the AddCol method.
The AddCol method has more than a dozen optional parameters, and you can specify only the required parameters using named arguments or simply by separating them with commas. The same is true for the AddRow method used to create rows one-by-one and many other methods of iGrid. Almost all methods support optional parameters, and this simplifies the use of this grid control in VB and VBA.
Pay attention to the fact that you can optionally specify unique string keys for columns and rows as we did this for the Person ID column above. If a column or row has a key, you can use it instead of the numeric index to access this column/row in your VB code:
iGrid1.CellValue(100, "id") = 30056This makes your code easily maintainable. Imagine a situation when you need to add a new column or remove existing one before a column with a specified key. You can continue access the cells in this column without adjusting the column numeric index in your code after every change in the column set of your VB grid control.
iGrid can be also populated with data from a DAO or ADO recordset with the FillFromRS method in one line of code. The data uploaded into this VB grid control can be formatted dynamically:
Dynamic data formatting is performed with events. You simply write an event handler for the corresponding event handler of the grid control as you could do this for any VB component. Below is the event handler for the RowDynamicFormatting event for the grid on the screenshot above:
Private Sub iGrid1_RowDynamicFormatting(ByVal lRow As Long, _ oForeColor As Long, oBackColor As Long, oFont As StdFont) If iGrid1.CellValue(lRow, "Country") = "USA" Then oBackColor = RGB(224, 192, 224) End If End SubiGrid provides you with a wide variety of events you can use from your VB code to adjust the behavior of this grid control and to get notifications about changes in it. These are events related to column movement and resizing, cell editing, mouse and keyboard operations, row grouping and so on.
The next pages in the Control Tour subsection allows you to find out more about this VB grid control.
Discover iGrid features in the Control Tour »
OverviewWhat iGrid Can DoDistinctive FeaturesVB Grid ControlControl Tour:• Main Features (I)• Main Features (II)• Group Rows and Row Texts• Built-in Cell Editors• Code Examples (I)• Code Examples (II)vbAccelerator SGrid ReplacementCompatibility InfoCustomer ReviewsWhat's New DemosExtra SamplesDocumentation ActiveX control (OCX)Works best in VB6 and VBALatest Version: 7.5.74 Excel VBA ListView controlvb6 datagrid controlmsflexgrid vb6 edit cellEditable ListViewvbalsgrid6.ocxactivex gridms access datagrid controlvb6 grid controlmsdatgrd.ocx not registeredVBA DataGridvisual basic grid controlTừ khóa » Visual Basic Grid Control
-
DataGrid Control Overview - Windows Forms .NET Framework
-
Cutting Edge: A New Grid Control In Windows Forms | Microsoft Docs
-
Get Started With Data Grid And Views | WinForms Controls
-
Getting Started With Windows Forms Grid Control - Syncfusion
-
How To Add A Windows Forms GridControl In Visual Basic 6.0?
-
FlexCell Grid Control - VB, VB.NET & C# Grid Control
-
Visual Basic And The DataGridView Control - Techotopia
-
Change Main View Dinamically (VB.Net) - Visual Studio 2010
-
Visual Studio 2019 WPF (VB.NET) Using The Grid Layout And Button ...
-
Grid Control Using VB.NET - Visual Basic .NET
-
FlexGrid For WinForms Data Grid - Visual Studio Marketplace
-
DevExpress WinForms: Getting Started With The Grid Control
-
Grid Components / Visual Studio 2017 - Best Selling
-
Using The Visual Basic DataGrid Control - MC Press Online