Getting the information from Column Header in a Datagrid
Posted on 2006-03-27
I have a datagrid that has been populated from a dataset.
I need to be able to loop though the grid and get the data from it.... i have the following working code....
For lngRow = 0 To dgData.VisibleRowCount - 1
For lngCol = 0 To dgData.VisibleColumnCount - 1
strData = strData & dgData.Item(lngRow, lngCol)
If lngCol < dgData.VisibleColumnCount - 1 Then strData = strData & vbTab
strData = strData & vbCrLf
This loops through each row and each column and adds the data to a string - however it only loops though the datagrid starting with the first record - it does not include the Field Names (columns headings)
can anyone tell me how to get the details of the column headings please???