We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





10203 Jan 26,2004 03:47 PM UTC Jan 26,2004 04:30 PM UTC WinForms 1
Tags: GridControl
Asked On January 26, 2004 03:47 PM UTC

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.

Administrator [Syncfusion]
Replied On 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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon