I have a RadGrid with using AllowAutomaticUpdates and EntityDataSource and I'd like to set some custom data (or override data) before the item is saved.
How do I do this?
I've tried this, but it doesn't work:
I don't *need* to have them as Grid Columns, but I figured this is what I'd have to do to get it work.
How do I do this?
I've tried this, but it doesn't work:
protected void rgUnits_UpdateCommand(object sender, GridCommandEventArgs e)
{
GridEditableItem item = (GridEditableItem)e.Item;
((RadDatePicker)item["LastModified"].Controls[0]).SelectedDate = DateTime.Now;
((TextBox)item["LastModifiedBy"].Controls[0]).Text = Context.User.Identity.Name;
}
<
telerik:GridDateTimeColumn
DataField
=
"LastModified"
FilterControlAltText
=
"Filter Last Modified"
HeaderText
=
"Last Modified"
SortExpression
=
"LastModified"
UniqueName
=
"LastModified"
ReadOnly
=
"true"
AllowFiltering
=
"true"
ColumnEditorID
=
"gceSmallDateBox"
DataFormatString
=
"{0:dd/MM/yyyy}"
PickerType
=
"DatePicker"
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridBoundColumn
DataField
=
"LastModifiedBy"
FilterControlAltText
=
"Filter Last Modified By"
HeaderText
=
"Last Modified By"
SortExpression
=
"LastModifiedBy"
UniqueName
=
"LastModifiedBy"
ReadOnly
=
"true"
AllowFiltering
=
"true"
>
</
telerik:GridBoundColumn
>
I don't *need* to have them as Grid Columns, but I figured this is what I'd have to do to get it work.