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.v21.1.dll

Declaration

public OrderedDictionary NewValues { get; }

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);
}
See Also