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.

Grid binding to Class

Thread ID:

Created:

Updated:

Platform:

Replies:

30234 Jun 14,2005 10:24 AM Jun 15,2005 09:55 AM Windows Forms 6
loading
Tags: GridControl
Brice
Asked On June 14, 2005 10:24 AM

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 10:44 AM

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.

Brice
Replied On June 14, 2005 05:46 PM

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.

Brice
Replied On June 15, 2005 07:42 AM

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 08:26 AM

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.

Brice
Replied On June 15, 2005 08:46 AM

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

Administrator [Syncfusion]
Replied On June 15, 2005 09:55 AM

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

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.

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.

;