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

Grid binding to Class

Thread ID:





30234 Jun 14,2005 02:24 PM UTC Jun 15,2005 01:55 PM UTC WinForms 6
Tags: GridControl
Asked On June 14, 2005 02:24 PM UTC

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?

Administrator [Syncfusion]
Replied On 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.

Replied On 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.

Replied On 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

Administrator [Syncfusion]
Replied On 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.

Replied On June 15, 2005 12:46 PM UTC

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

Administrator [Syncfusion]
Replied On 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


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