GridListControl

Is there a way to populate the gridlistcontrol without using a datasource? I am trying to display a couple columns in the gridlistcontrol. I have 1 rows x N columns. The number of columns are dynamic. Is this feasible? thanks.

1 Reply

AD Administrator Syncfusion Team January 26, 2004 04:30 PM UTC

The gridListControl1 does not ''store'' any data. So, you do have to have some datasource. There are several things you could try to do. You can just manually populate a datatable and use that as the datasource. That would be the simplest thing to do. Here is some sample code: Dim dt As New DataTable("MyTable") Dim nCols As Integer = 4 Dim nRows As Integer = 10 Dim i As Integer Dim j As Integer For i = 0 To nCols - 1 dt.Columns.Add(New DataColumn(String.Format("Col{0}", i))) Next For i = 0 To nRows - 1 Dim dr As DataRow = dt.NewRow() For j = 0 To nCols - 1 dr(j) = String.Format("row{0} col{1}", i, j) Next dt.Rows.Add(dr) Next

Loader.
Up arrow icon