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.
Syncfusion Feedback

GridDataBoundGrid bound to ArrayList

Thread ID:

Created:

Updated:

Platform:

Replies:

64083 Jul 13,2007 04:13 PM UTC Jul 23,2007 09:31 PM UTC Windows Forms 4
loading
Tags: GridControl
Grace
Asked On July 13, 2007 04:13 PM UTC

Hi,

I have a GridDataBoundGrid bound to an ARrayList.
I want to add a button which on clicking should enable the user to add new values from to Grid into the ArrayList.

This I think can be done by IBindingList support, I am looking for a sample code. I am missing something .. but I dont know where and what.

Any psuedo code or a sample code which binds and allows user to add new rows to the ArrayList would be really helpful.

Tnx.

haneefm [Syncfusion]
Replied On July 13, 2007 05:44 PM UTC

Hi Grace,

Below is a minimal sample that shows this task.Please try this and let me know if this helps.
GDBGArrayList.zip

Best regards,
Haneef

Grace
Replied On July 22, 2007 07:25 PM UTC

Have a question here:

First off: If the User edits any values in the grid, Will they be saved to the Arraylist automatically? Or Is coding required to grab these changes and put them into the underlying datasource: which is the ArrayList

2. The application I am maintaining, does not show me the extra blank row that is added at the end of the grid. Why is that? Is there a property that suppresses the creation of the blank row at the end.

>Hi Grace,

Below is a minimal sample that shows this task.Please try this and let me know if this helps.
GDBGArrayList.zip

Best regards,
Haneef

haneefm [Syncfusion]
Replied On July 23, 2007 05:41 PM UTC

Hi Grace,

1.If the User edits any values in the grid, Will they be saved to the Arraylist automatically? Or Is coding required to grab these changes and put them into the underlying datasource: which is the ArrayList
>>>>>>>>>>>>>>>>>>>>>>>>>>>
In General,The databound grid will push all data for a row into the underlying datasource(datatable,ArrayList,etc...) for every record once you move the current cell of that record. Once the changes for a record have been pushed into the datasource the grid has no more knowledge about these changes and thus cannot reverse and undo these changes.It does not push all data for a row into the underlying datasource for every cell movement.If you want to push all data to undelying datasource for every cell movement,you need to call in Binder.EndEdit Method(before calling this , you need to call the CurrentCell''s Edit method).

2. The application I am maintaining, does not show me the extra blank row that is added at the end of the grid. Why is that? Is there a property that suppresses the creation of the blank row at the end.
>>>>>>>>>>>>>>>>>>>>>>>>>>>
Extra blank row is called as AddNewRow. You can control the add new row by setting the EnableAddNew property. The grid only supports adding new records if the underlying datasource allows it.(ArrayList doesn't support AddNewRecord). Starting an edit on the addnew row will automatically create the next addnew row. This is MS-Access type behavior, always showing an empty addnew row.

Best regards,
Haneef

grace nethala
Replied On July 23, 2007 09:31 PM UTC

Thanks a lot Haneef! Answered my questions.

>Hi Grace,

1.If the User edits any values in the grid, Will they be saved to the Arraylist automatically? Or Is coding required to grab these changes and put them into the underlying datasource: which is the ArrayList
>>>>>>>>>>>>>>>>>>>>>>>>>>>
In General,The databound grid will push all data for a row into the underlying datasource(datatable,ArrayList,etc...) for every record once you move the current cell of that record. Once the changes for a record have been pushed into the datasource the grid has no more knowledge about these changes and thus cannot reverse and undo these changes.It does not push all data for a row into the underlying datasource for every cell movement.If you want to push all data to undelying datasource for every cell movement,you need to call in Binder.EndEdit Method(before calling this , you need to call the CurrentCell's Edit method).

2. The application I am maintaining, does not show me the extra blank row that is added at the end of the grid. Why is that? Is there a property that suppresses the creation of the blank row at the end.
>>>>>>>>>>>>>>>>>>>>>>>>>>>
Extra blank row is called as AddNewRow. You can control the add new row by setting the EnableAddNew property. The grid only supports adding new records if the underlying datasource allows it.(ArrayList doesn't support AddNewRecord). Starting an edit on the addnew row will automatically create the next addnew row. This is MS-Access type behavior, always showing an empty addnew row.

Best regards,
Haneef

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

;