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

Bound grid not adding new

Hopefully this is something really simple but as I'm new to Syncfusion its got me stumped. I'm creating a relatively simple form that hosts the DataBoundGrid. At runtime a ListArray is populated and then bound to the grid and a series of GridBoundColumns are specified. Everything works great except ... I can't add new records. I have the AddNew property set to true.

I tried replacing the ListArray with a DataTable and no GridBoundColumns and it works (this suggests to me I have the basic properties of the grid set correctly). I applied the GridBoundColumns and it stopped working. So thinking it was something to do with the GridBoundColumns I reinstated the ListArray but this time without the GridBoundColumns. No luck.

All the Syncfusion examples I've looked at so far have a datatable imbedded in the solution and bound at design time.

So, is it possible to have AddNew functioning on a DataBoundGrid with GridBoundColumns that has been bound to a ListArray at runtime?

(I'm using Essential Studio 5.2.0.25, VS2005 C#, Win XP Prof)

Regards PLST




1 Reply

SR SubhaSheela R Syncfusion Team January 8, 2008 10:17 AM UTC

Hi Peter,

Thank you for using Syncfusion products.

You cannot add new items directly to the ArrayList through the grid. But you can add new items to ArrayList by implementing IBindingList interface since AddNew method is available only in that interface. Implementation of IBindingList.AddNew as well as the IBindingList.AllowNew property will let you to add new rows.

Please refer to the simple sample available in the below link that illustrates the same:

http://websamples.syncfusion.com//samples/ Grid.Windows//F70854/main.htm

For more details, you can refer our online documentation or the local documentation available in the dashboard under the category:
Essential Grid---->Grid Control---->Basic concepts ---->GridDataBoundGrid Use Cases---->Binding to an ArrayList---->ArrayList Class with IBindingList Support

Kindly let me know if you have any questions.

Regards,
Subhasheela R




Loader.
Live Chat Icon For mobile
Up arrow icon