protected void gridviewAllocation_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e) { //Set default data if (InitNewRowWithDefaultDataEvent != null) { TransactionInitRowData defaultData = new TransactionInitRowData(); InitNewRowWithDefaultDataEvent(defaultData); SetTransactionInitRowData(e, defaultData); } }
private void SetTransactionInitRowData(DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e, TransactionInitRowData data) { if (data != null) { if (data.Amount != double.MinValue) { e.NewValues["Amount"] = data.Amount; } if (data.Code != null && data.Code.Trim().Length > 0) { e.NewValues["Code"] = data.Code; } if (data.Description != null && data.Description.Trim().Length > 0) { e.NewValues["Description"] = data.Description; } if (data.IssuedDate != DateTime.MinValue) { e.NewValues["IssueDate"] = data.IssuedDate; } } }