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

Saving ASP.net session UserId in a column when inserting into Radgrid

1 Answer 10 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sheo
Top achievements
Rank 1
Sheo asked on 21 Oct 2008, 12:47 PM
Hello,

I am using the online demo below to insert data in the table Employees
http://demos.telerik.com/aspnet/prometheus/Grid/Examples/DataEditing/TemplateFormUpdate/DefaultCS.aspx

I have added a column Created_By to the table. I want to populate the Created_By colum with the ASP.net userid who is logged in the session and who is inserting that record in the table. Please help.

Regards
Sheo Jha
sheojha@gmail.com

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 23 Oct 2008, 10:28 AM
Hi Sheo,

I suggest that you handle the ItemCommand event of RadGrid and check there if the command is InitInsert command. Then you can insert the desired value as shown in this topic, under the Setting predefined values for controls inside FormTemplate on item insertion section.

I hope this helps.

All the best,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Sheo
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or