0

I have a list of columns

Dim ListCol As List(Of System.Data.DataColumn)
            For Each Col As System.Data.DataColumn In Grid.Columns
                ListCol.Add(Col)
            Next

I need the user friendly name of the columnl not the actual name of the column but the one displayed to the user.

Dim rr As Report.ReportRow() = Settings.Report.Select("rField = '" & ListCol.Item(i).DataPropertyName & "' AND rIsDefault = true")

I can't access the datapropertyname unless its a datagridview object. Im assumning I need to convert it to a datagridview but I was hoping to find a method of System.data.Datacolumn that would return the same text as if I asked for datagridview.DataPropertyName.

Ccorock
  • 892
  • 12
  • 37

1 Answers1

1

I think you're actually looking for System.Data.DataColumn.Caption. This lets you set a user-friendly name for the column.

lc.
  • 113,939
  • 20
  • 158
  • 187
  • This saved me time in changing all the captions on the DataGridView too, as I have been doing for too long. Thank you good sir. – Ccorock Sep 20 '12 at 16:38