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.
Unfortunately, activation email could not send to your email. Please try again.

ArrayList as a Datasource for GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

20798 Oct 26,2004 05:35 AM Oct 27,2004 02:54 AM Windows Forms 7
loading
Tags: GridControl
Thiyagu
Asked On October 26, 2004 05:35 AM

Hi Clay, Is it possible to have Arraylist as a Datasource for DataBound Grid. I dont find any reason for no as ArrayList Implements Ilist adapter. But, When I try to do that, the Grid is having only length of the values present in the Array. Thiagu.

Administrator [Syncfusion]
Replied On October 26, 2004 05:45 AM

You can have an ArrayList as a DataSource in a GridDataBoundGrid. The simplest way is to have the objects in the ArrayList have public properties with the values you want to see in the columns. Here is a little sample. GDBGArrayList_9458.zip

Thiyagu
Replied On October 26, 2004 06:16 AM

Thanks Clay. Thanks for your reply. >You can have an ArrayList as a DataSource in a GridDataBoundGrid. The simplest way is to have the objects in the ArrayList have public properties with the values you want to see in the columns. Here is a little sample. > >GDBGArrayList_9458.zip > >

Thiyagu
Replied On October 26, 2004 11:26 PM

Hi Clay, Is there anyway to specify the Order of the column explicitly??. As of now, the DataGrid is showing my Third column in the Array list as the First column in the Grid. Thanks in Advance, Thiagu >Thanks Clay. Thanks for your reply. > >>You can have an ArrayList as a DataSource in a GridDataBoundGrid. The simplest way is to have the objects in the ArrayList have public properties with the values you want to see in the columns. Here is a little sample. >> >>GDBGArrayList_9458.zip >> >>

Administrator [Syncfusion]
Replied On October 27, 2004 12:22 AM

To specify which columns you see and their order, you create GridBoundColumn objects for each column and add them to the grid.GridBoundColumns collection in the order you want them to appear.

Thiyagu
Replied On October 27, 2004 01:24 AM

I tried out. But its not working. It is displaying none. It will be helpful if you can post a Sample for this. Thiagu >To specify which columns you see and their order, you create GridBoundColumn objects for each column and add them to the grid.GridBoundColumns collection in the order you want them to appear. > >

Administrator [Syncfusion]
Replied On October 27, 2004 02:29 AM

There are 2 points to consider. 1) Make sure you set the gridBoundColumn.MappingName properly, it is case sensitive. 2) And if you add the GridBoundColumns after you set the DataSource to the grid, then you also have to call grid.Binder.InitializeColumns to make sure the grid uses the columns exclusively, and does not mixed them up with the default gridboundcolumns that were added when you set the datasource. GDBGArrayList_3275.zip

Thiyagu
Replied On October 27, 2004 02:54 AM

Thanks Clay. I missed out the Mapping name. Thanks a lot, Thiyagu.

CONFIRMATION

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.

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.

;