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

AddNew - IBindingList

Thread ID:





37968 Dec 2,2005 08:45 PM UTC Dec 3,2005 11:39 AM UTC WinForms 2
Tags: GridControl
Martin Cyr
Asked On December 2, 2005 08:45 PM UTC

I''m having some problems with my IBindingList again. Sometimes, when I set the grids datasource to my collection, I cannot add new items to the collection, but when I bind it to the same collection but with items in it, it works nicely. Even if I remove every item from my collection, it works, I can still add things. But if my collection is plain new when I datasource the grid to it, then no way I can add new elements: the blank line is there but no call to my collection addNew function is made, I can select data from a combo column (datasourced to some other data), but then, the grid doesn''t add another blank line for a new entry, and whenever I move currentcell, the data entered disapears.

Martin Cyr
Replied On December 2, 2005 09:23 PM UTC

In case my explanation would be confusing or unclear, here is a sample illustrating the behaviour that I described. Just comment the second For loop in the Form1_Load to see the problem. P.S. We''re using SF Essential Studio 3.301.0.0


Administrator [Syncfusion]
Replied On December 3, 2005 11:39 AM UTC

Thanks for the sample. When your list is empty, then grid needs to be able to get at the type of the objects in the list in order to initialize the associated property descriptors properly. In your collection, you added an attribute to indicate the type of the object in the collection. But Essential Grid does not look for this type of attribute. Instead, it relies on the collection implementing ITypedList to enable it to handle empty lists as datasources. So, I was able to get you sample working by adding Implements System.ComponentModel.ITypedList and
    Public Function GetItemProperties(ByVal listAccessors() As System.ComponentModel.PropertyDescriptor) As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ITypedList.GetItemProperties
        Return System.ComponentModel.TypeDescriptor.GetProperties(GetType(Blah))
    End Function

    Public Function GetListName(ByVal listAccessors() As System.ComponentModel.PropertyDescriptor) As String Implements System.ComponentModel.ITypedList.GetListName
        Return "Blah"
    End Function
to your collection class.


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