Question

I have a gridview displaying data by using an Obejct Data Source which is then connected to a Business Layer.

The data shown/retrieved is from two tables with a join.

Is it possible to have a custom update method which, when the user clicks edit against the row, it will update only the one table out of the two that's required for the data shown (however if it can update the entire record that's fine too)? If yes how do i tie the ODS, along with my BL? Any info would be appreciated as my research so far has not given any examples of this.

To give an example one table is a user and the other table is results. The Results table is connected to the Users table by a UserID (foreign key) but the gridview shows a little more info when both tables are joined.

Was it helpful?

Solution

You can place a linkbutton inside a template field & give it CommandName="MyUpdate". You can then check for the commandName on rowCommand event of gridview & handle your custom update there.

if(e.CommandName =="MyUpdate")
{
      // Perform your update
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top