I have a RadGrid bound to a LinqDataSource for Products. I want to set 1 of the product values manually (in code behind) while the user can set the rest using bound controls. THe problem is I can not figure out how to manually set the value.
I tried to create a hidden bound column (Display=false) for the field, and then in the UpdateCommand event of the RadGrid, I did the following:
I stepped through the code and the value is set properly, but it never gets updated in the database. I can only assume my approach is not correct and further searches through the forums has yielded no results either.
How can I get access to the current linq object being updated and set this one member in the codebehind when the user updates so that my value is saved along with their values?
Thanks so much!
Michael
I tried to create a hidden bound column (Display=false) for the field, and then in the UpdateCommand event of the RadGrid, I did the following:
protected void rgProducts_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) | |
{ | |
// re show the edit column | |
rgProducts.Columns[0].Visible = true; | |
// set some values manually | |
GridEditFormItem item = e.Item as GridEditFormItem; | |
item.ParentItem["UpdatedBy"].Text = UserId.ToString(); | |
} |
I stepped through the code and the value is set properly, but it never gets updated in the database. I can only assume my approach is not correct and further searches through the forums has yielded no results either.
How can I get access to the current linq object being updated and set this one member in the codebehind when the user updates so that my value is saved along with their values?
Thanks so much!
Michael