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
close icon

Data Bound Grid with bound & non bound columns

Hello, My application has following requirement: Data Bound Grid should have two bound columns ContactID & Percent from table A and three non bound (No Mapping name) columns from another table. These three columns basically just displays contact info like Given name, surname etc for given ContactID. Both bound columns are editable. On edit of ContactId, other three non bound columns should be updated. When my program try to update those non bound columns by grabing row & column index, value of bound columns disappear as well as non bound columns does not display anything. I am not sure whether I am correct in combining bound & non bound coulmns from two different table. Any suggestion please? thanks for reply to my last question.

1 Reply

AD Administrator Syncfusion Team July 31, 2004 06:13 AM UTC

Take a look at the Grid\Samples\DataBound\MultiHeader sample. It adds an unbound checkbox on the left side and an unbound column on the right side. The steps are: 1) Add a GridBoundColumn in the GridBoundColumns collection (or Binder.InternalColumns if you have not explicitly added GridBoundColumns). In the sample, serach for "Unbound" to see this code. 2) Add some datastructure to hold the data that is to occupy this column. The sample uses a HashTable unboundValues. You would get yours directly from the second DataTable. 3) Handle the GridDataBoundGrid.Model.QueryCellInfo event to provide the values to the grid from your second DataTable for your unbound column. See ModelQueryCellInfo in the sample. 4) Handle the GridDataBoundGrid.Model.SaveCellInfo event to save the values from the unbound column to the second DataTable. See ModelSaveCellInfo in the sample.

Loader.
Live Chat Icon For mobile
Up arrow icon