This is a migrated thread and some comments may be shown as answers.

save information into another table when update button is pressed

2 Answers 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Syed
Top achievements
Rank 1
Syed asked on 06 May 2009, 09:33 PM

Hi,

i displayed rows in the RadGrid and i am performing Edit and update to the particular row.

i am tracking the details of the users whoever updating the rows. i have a table tracking_users and i want to store the details into this tracking table.

Basically what i need is that whenever update button is press some information to be stored into another table.

Thanks.

Regards
Arshad

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 07 May 2009, 05:33 AM
Hi Arshad,

I guess you are trying to access the user information from the updated Grid row. If so you can set the required DataField as the DataKeyName. Access its value in the Update command event and hence insert the data into the tracking_users table.

CS:
 
 
  protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) 
    { 
        GridEditableItem edititem = (GridEditableItem)e.Item; 
         
        //access the DataKeyValue for the updated row here 
        int userID = Convert.ToInt16(edititem.GetDataKeyValue("UserID ")); 
    } 


Shinu.
0
Syed
Top achievements
Rank 1
answered on 07 May 2009, 07:59 PM
Thanks.

Here i am inserting a new record into another table when an update command performs on the RadGrid. I get an idea from you updatecommand event.

Anyhow thanks for the wonderful idea.

protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) 
{
Here i am creating new connection and inserting a new record into the table.
}

Best Regards
Arshad

Tags
Grid
Asked by
Syed
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Syed
Top achievements
Rank 1
Share this question
or