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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ArrayList as a Datasource for GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

20798 Oct 26,2004 09:35 AM UTC Oct 27,2004 06:54 AM UTC WinForms 7
loading
Tags: GridControl
Thiyagu
Asked On October 26, 2004 09:35 AM UTC

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 09:45 AM UTC

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 10:16 AM UTC

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 27, 2004 03:26 AM UTC

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 04:22 AM UTC

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 05:24 AM UTC

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 06:29 AM UTC

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 06:54 AM UTC

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.

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

;