protected void gridPersonDet3_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxTextBox id = this.grid.FindEditFormTemplateControl("txt_Id") as ASPxTextBox; e.NewValues["Person"] = SafeValue.SafeInt(id.Text, 0); ASPxGridView grd = sender as ASPxGridView; ASPxCheckBox isPayroll = grd.FindControl("ckb_IsPayroll") as ASPxCheckBox; if (isPayroll.Checked) { e.NewValues["IsPayroll"] = true; } else { e.NewValues["IsPayroll"] = false; } e.NewValues["CreateBy"] = HttpContext.Current.User.Identity.Name; e.NewValues["CreateDateTime"] = DateTime.Now; }
public static DateTime GetDate(ASPxGridView from, string keyId) { DateTime res = new DateTime(1900, 1, 1); if (from != null) { ASPxDateEdit cc = null; try { cc = (ASPxDateEdit)from.FindControl(keyId); } catch { } if (cc != null) { res = cc.Date; } else { throw new Exception(string.Format("It isnot ASPxDateEdit.[{0}]", keyId)); } } return(res); }