ASPxDataInsertingEventArgs.NewValues Property
Gets a dictionary that contains the new field name/value pairs for the row to be inserted.
Namespace: DevExpress.Web.Data
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Description |
---|---|
OrderedDictionary | A OrderedDictionary object that contains a dictionary of the new field name/value pairs for the row to be inserted. |
Remarks
Note
To set or get a value for a row, use a field name of a corresponding column.
Example
Note
For a full example, refer to the ASPxGridView - Editing an in-memory dataset.
protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) {
ds = (DataSet)Session["DataSet"];
ASPxGridView gridView = (ASPxGridView)sender;
DataTable dataTable = gridView.GetMasterRowKeyValue() != null ? ds.Tables[1] : ds.Tables[0];
DataRow row = dataTable.NewRow();
e.NewValues["ID"] = GetNewId();
IDictionaryEnumerator enumerator = e.NewValues.GetEnumerator();
enumerator.Reset();
while(enumerator.MoveNext())
if(enumerator.Key.ToString() != "Count")
row[enumerator.Key.ToString()] = enumerator.Value;
gridView.CancelEdit();
e.Cancel = true;
dataTable.Rows.Add(row);
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the NewValues property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.