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

Grid binding to Class

I bind my grid to a class that derives from Ibinding interface, it works fine but when i go to a new cell the text disappears from the previous cell . Can you help?

6 Replies

AD Administrator Syncfusion Team June 14, 2005 02:44 PM UTC

If you bind your derived class to a windows forms datagrid, can you edit things there and save the changes? If you can upload a sample project showing what youare doing, we can try to debug it here.

BR Brice June 14, 2005 09:46 PM UTC

Yes with a windows datagrid it works fine, I have a comboBox as cell type, and I want the selected string from the dropdown to be stores in a class (that implement IBinding and derives from collection) i set the class name as datasource and one of the string property as mapping name of the column, in the cell style properties i''ve set the value member to be that same string property (from the collection class), when i select a value from the combobox it appears as the cell value until i click on a new cell or an existing one. i will try to make a short sample for you.

BR Brice June 15, 2005 11:42 AM UTC

Hi, Here is a sample, while making the sample I realized the problem is due to the fact that the binding to the class is not working and there is no call for addnew when a new cell is insert. see attached zip bindingclass test_828.zip

AD Administrator Syncfusion Team June 15, 2005 12:26 PM UTC

In your sample, you have not set a MappingName for this.gridBoundColumn1. You need to teel the grid what property in your class1 you want this column mapped to. Without setting this property, the grid does not know where to store the result of your combobox selection. Also note, since you did not set this.gridBoundColumn1.ValueMember, the result of the selction will be the object from the dataset which is a datarowview object. So, if you do not set a ValueMember, then the grid will expect class1 to have a property that is a DataRowView object in order for things to match up.

BR Brice June 15, 2005 12:46 PM UTC

I''ve set both properties but still nothing see attached zip bindingclass test_6253.zip

AD Administrator Syncfusion Team June 15, 2005 01:55 PM UTC

Here is your sample back. There was no setter method on the StrGrid property, so it was readonly. http://www.syncfusion.com/Support/user/uploads/bindingclass test_5d09f6bb.zip

Live Chat Icon For mobile
Up arrow icon