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

populating table with grid values

Hi, I have a grid that writes to an xml file. Before the user saves the grid to the file I need to populate some records in a table that is part of the schema, but not part of the grid. Basically I need to select the contents of one table and use those values to populate this other table. Do you have an example of a statement of this type? Thanks, CB

3 Replies

AD Administrator Syncfusion Team February 5, 2004 02:38 PM UTC

I do not have a sample for this,a dn am not sure what role the grid would play in this task. Maybe you could loop through code like this: gridDataTable.Rows[someRowPos][someColPos] = secondDataTable.Rows[someOtherRowPos][someOtherColPos]; I am not sure how you want to determine the row and col positions for use with each assignment.


AD Administrator Syncfusion Team February 5, 2004 02:55 PM UTC

Hi, I guess what I''m asking is, can I access the tables directly in the datasource when the user is finished editing the grid and add data to one of those tables. I would like to avoid using the grid at all and just use regular sql as in: ''Update table1 set table1.field1 = table2.field1 where table1.field2 = table2.field2'' - or something like that. If this is possible do you know what the syntax would be for accessing the tables in the datasource and running a query of this type? Thanks >I do not have a sample for this,a dn am not sure what role the grid would play in this task. > >Maybe you could loop through code like this: > >gridDataTable.Rows[someRowPos][someColPos] = secondDataTable.Rows[someOtherRowPos][someOtherColPos]; > >I am not sure how you want to determine the row and col positions for use with each assignment.


AD Administrator Syncfusion Team February 5, 2004 03:19 PM UTC

I do not know how you might do this using a SqlCommand or something like it. It probably is possible, but it is not something I have attempted. If the DataSource object is a System.Data.DataTable, then you should be able to use any valid operations on that object.

Loader.
Live Chat Icon For mobile
Up arrow icon