Pregunta

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.

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top