Im creating a desktop application in Visual Basic 6.0 and im having trouble getting the data from datagrid.

Im used to using DataGridView commands in Visual Basic .Net but its not available in VB6.

I already tried using datagrid1.textmatrix but its not available for the datagrid controls.

I think .textmatrix is a Flexgrid control.

i know i have to use looping for this but i dont know the commands for getting the data in the data grid.

Can anyone give me an insight.. thx

I use this code to get the data from datagrid in Visual Basic .Net

Dim rows As DataGridViewSelectedRowCollection = Me.dgvArea.SelectedRows

                        For Each row As DataGridViewRow In rows

                            Dim myrow As DataRowView = CType(row.DataBoundItem, DataRowView)

                            IntAreaID = CInt(myrow(0))

                            Me.txtAreaCode.Text = myrow(1).ToString

                            Me.txtAreaName.Text = myrow(2).ToString

                            Me.txtAreaDescription.Text = myrow(3).ToString


can someone show me the equivalent of this in VB6?

This following code to get data from datagrid..

DataGrid1.Row = 0 ' first row.. just looping as many of datagrid rows 

Edited 5 Years Ago by Jx_Man: n/a

thx Jx_Man.. thats Exactly what im looking for.

This question has already been answered. Start a new discussion instead.