Welcome Guest Search | Active Topics | Sign In | Register

Best practice... adding a row in GridView Options
mark836
Posted: Thursday, May 15, 2008 7:08:12 AM
Rank: Member
Groups: Member

Joined: 5/1/2008
Posts: 16
Hi,

I have a classic example of two GridViews each appearing to have the same columns. The user has the ability of moving a row in Grid1 and adding it to Grid2 (perhaps a button for each row and do a postback?).

I am assuming I insert a row in Grid2, copy the values from Grid1 to Grid2, and remove row from Grid1.

What is the best way to accomplish this with your Grid object?

Thanks!
eo_support
Posted: Thursday, May 15, 2008 7:12:27 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,090
Hi Mark,

It will be pretty much the same. Two GridView does not directly interact with each other, this is also the case for our Grid.

Once difference is, our Grid always populate from a DataSource. So whether it's deleting or inserting, you must update your data source first.

Thanks
mark836
Posted: Thursday, May 15, 2008 7:17:22 AM
Rank: Member
Groups: Member

Joined: 5/1/2008
Posts: 16
Sorry for the confusion. I didn't explain myself properly.

I want to add a row in a Grid and delete a row in a Grid. ( I won't be updating any datasources until the user has finished manipulating all data in my grids.)

what is the best practice for doing this with your object?


thanks
eo_support
Posted: Thursday, May 15, 2008 7:22:52 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,090
mark836 wrote:
I want to add a row in a Grid and delete a row in a Grid. ( I won't be updating any datasources until the user has finished manipulating all data in my grids.)


That's what I was telling you....you can NOT do that without updating your datasource.

However, the Grid's DataSource doesn't necessary to be your database. For example, you can fill a DataTable from your database, then add/delete on that DataTable and use that DataTable as the Grid's DataSource. By the time you are ready to save all the changes, you can then save the changes from the DataTable back to your database.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.