Hi,
is there a simple way to get the old (and the new values) of GridBoundColumns inside the update/insert command?
I have bound my data manually to the grid. (By setting the DataSource to a DataTable)
Three fields are relevant. (UID, DCId, MRDR_NR). I only showup some of these in the Editmode.
Now i just want to update a value in my DataTable. Like (update xy set MRDR_Nr=NEW where UID=OLD).
How can i get the OLD and NEW Values inside the UpdateCommand?
I found an example to find out the OLD Values of my data. But not the NEW Values. And not by FieldNames.
Is there a way to get the data of my columns?
Like "item["DCId"].value" (old and new)?
is there a simple way to get the old (and the new values) of GridBoundColumns inside the update/insert command?
I have bound my data manually to the grid. (By setting the DataSource to a DataTable)
Three fields are relevant. (UID, DCId, MRDR_NR). I only showup some of these in the Editmode.
| <mastertableview editmode="EditForms" |
| enableheadercontextmenu="True" |
| insertitempageindexaction="ShowItemOnFirstPage" |
| ShowGroupFooter="True" InsertItemDisplay="Bottom" |
| DataKeyNames="UID" CommandItemDisplay="Bottom"> |
| <Columns> |
| <telerik:GridBoundColumn |
| DataField="UID" ReadOnly="True" |
| HeaderText="UID" UniqueName="UID" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="DCId" |
| HeaderText="DCId" UniqueName="DCId"> |
| <ItemStyle Width="100" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="MRDR_NR" HeaderText="MRDR_NR" UniqueName="MRDR_NR"> |
| <ItemStyle Width="100" /> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </mastertableview> |
Now i just want to update a value in my DataTable. Like (update xy set MRDR_Nr=NEW where UID=OLD).
How can i get the OLD and NEW Values inside the UpdateCommand?
I found an example to find out the OLD Values of my data. But not the NEW Values. And not by FieldNames.
| protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) |
| { |
| GridEditableItem editedItem = e.Item as GridEditableItem; |
| GridEditManager editMan = editedItem.EditManager; |
| foreach (GridColumn column in e.Item.OwnerTableView.RenderColumns) |
| { |
| if (column is IGridEditableColumn) |
| { |
| IGridEditableColumn editableCol = (column as IGridEditableColumn); |
| if (editableCol.IsEditable) |
| { |
| IGridColumnEditor editor = editMan.GetColumnEditor(editableCol); |
| string editorText = "unknown"; |
| object editorValue = null; |
| if (editor is GridTextColumnEditor) |
| { |
| editorText = (editor as GridTextColumnEditor).Text; |
| editorValue = (editor as GridTextColumnEditor).Text; |
| } |
Is there a way to get the data of my columns?
Like "item["DCId"].value" (old and new)?