Home Forums WinForms controls Xceed Grid for WinForms Empty grid after databinding.. Reply To: Empty grid after databinding..

Xceed Support
Post count: 5658

I tried pretty much the same code as you and it worked fine.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
With GridControl1
.DataSource = GetTable()
End With

End Sub

Private Function GetTable() As DataTable
‘Create a DataTable
Dim dt As New DataTable()
Dim dcId As New DataColumn()
dcId.ColumnName = “ComplexId”
dcId.DataType = System.Type.[GetType](“System.Int64”)

Dim dcName As New DataColumn()
dcName.ColumnName = “ComplexName”
dcName.DataType = System.Type.[GetType](“System.String”)
For i As Integer = 0 To 49

Dim row As System.Data.DataRow = dt.NewRow()
row(“ComplexId”) = i
row(“ComplexName”) = i.ToString() + “%”

Return dt
End Function

Imported from legacy forums. Posted by CharlesB (had 184 views)