Posted 17 June 2020, 4:27 pm EST
Hi
Can’t get this to work:
Dim dc As New C1DataColumn
dc.DataField = “Kflag”
Dim iCol = C1Combo1.Columns.IndexOf(dc)
iCol is -1
This works:
Dim iCol As Integer = -1
For i = 0 To C1Combo1.Columns.Count - 1
If C1Combo1.Columns(i).DataField = “Kflag” Then
iCol = i
Exit For
End If
Next
iCol is correct column.
(Datasource is datatable)
Must say I’m not sure about the use of C1DataColumn. In other controls it’s possible to use string in IndexOf, but in C1Combo it need to be C1DataColumn.
I’m using ComponentOne Studio for WinForms (.NET 4.0) 4.0.20183.343