protected void grid_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { e.NewValues["CreateDateTime"] = DateTime.Now; }
protected void gvProducts_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { ((GridViewDataColumn)gvProducts.Columns["Tallas"]).EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.False; ((GridViewDataColumn)gvProducts.Columns["Imágenes"]).EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.False; ((GridViewDataColumn)gvProducts.Columns["Stock"]).EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.False; ((GridViewDataColumn)gvProducts.Columns["Tipo Producto"]).EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.True; }
protected void gv_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { ASPxGridView grid = sender as ASPxGridView; grid.DetailRows.CollapseAllRows(); grid.DetailRows.ExpandRow(grid.EditingRowVisibleIndex); }
protected void Compvar_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { var key = (sender as ASPxGridView).GetMasterRowKeyValue(); Session["compvar_pk"] = key; //e.NewValues["ref_groupID"] = "0"; e.NewValues["varweight"] = "1"; }
protected void ASPxgvTransfers_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { string name = Session["TransferUser"].ToString(); string createdby = Session["UserName"].ToString(); var user = _context.Users.Where(u => u.UserName == name).Single(); e.NewValues["FromTaxOfficeId"] = user.TaxOfficeId; e.NewValues["CreatedBy"] = user.TaxOfficeId; }
protected void WorkWeekGrid_OnInitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { var workWeek = WorkWeek.GetTheMostRecentWorkWeek(); if (workWeek != null) { var startDate = workWeek.EndDate.AddDays(1); e.NewValues["StartDate"] = startDate; e.NewValues["EndDate"] = startDate.AddDays(6); e.NewValues["Caption"] = string.Format("{0}-ს", startDate.ToString("MMM dd, yyyy", CultureInfo.CreateSpecificCulture("ka-ge"))); } }
protected void gvDirecciones_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { var LicTradNum = txtCrLicTradNum.Text; var contador_direcciones = ((List <BEClientAddress>)Session["dire"]).Count + 1; if (!string.IsNullOrWhiteSpace(LicTradNum)) { e.NewValues["Active"] = "Activo"; e.NewValues["Address"] = LicTradNum + "00" + contador_direcciones; } }
protected void grid_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { processAddNewRow = true; grid.FilterExpression = "false"; // This trick is required to hide all grid rows except for the new row's Edit Form. ASPxMenu menu = (ASPxMenu)grid.FindEditFormTemplateControl("editFormMenu"); menu.Items.FindByName("miNew").ClientEnabled = false; menu.Items.FindByName("miDelete").ClientEnabled = false; menu.Items.FindByName("miRefresh").ClientEnabled = false; menu.Items.FindByName("miUpdate").ClientEnabled = true; menu.Items.FindByName("miCancel").ClientEnabled = true; }
public void DefaultNewRowInitializeFields(ASPxDataInitNewRowEventArgs e) { e.NewValues["CreatedBy"] = UtilitySystem.CurrentUserName; e.NewValues["UpdatedBy"] = UtilitySystem.CurrentUserName; e.NewValues["CreateDateTime"] = DateTime.UtcNow; e.NewValues["UpdatedDateTime"] = DateTime.UtcNow; if (HistoricalRow) { e.NewValues["StartDateTime"] = DateTime.UtcNow; e.NewValues["EndDateTime"] = DateTime.MaxValue; } }
protected void ASPxgvAssessments_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { Session["IAssessmentId"] = null; ASPxgvAssessments.SettingsText.PopupEditFormCaption = "New Assessment"; ASPxPageControl AspxPageControl1 = (ASPxPageControl)ASPxgvAssessments.FindEditFormTemplateControl("AspxPageControl1"); AspxPageControl1.ActiveTabPage = AspxPageControl1.TabPages[0]; foreach (TabPage tab in AspxPageControl1.TabPages) { tab.Enabled = tab.Index == 0 ? true : false; } }
protected void dxgridLogContact_OnInitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { e.NewValues["logdate"] = System.DateTime.Now; //SQL_utils sql = new SQL_utils("backend"); //int default_studyID = sql.IntScalar_from_SQLstring("select coalesce(defaultstudyID,0) from tblstaff where actdirID = sec.systemuser()"); //int hh_studyID = sql.IntScalar_from_SQLstring("select top 1 studyID from trk.vwMasterStatus_S where householdID = " + Request.QueryString["hhID"] + " group by studyID order by count(*) desc"); //if (default_studyID == 0 & hh_studyID > 0) //{ // sql.NonQuery_from_SQLstring("update tblStaff set defaultstudyID = " + hh_studyID.ToString() + " where actdirID = sec.systemuser()"); // Master.GetCurrentDefaultStudyID(); //} //sql.Close(); }
protected void InsertData(object sender, ASPxDataInitNewRowEventArgs e) { e.NewValues["data_poczatkowa"] = DateTime.Now.Date; DateTime dataKoncz = DateTime.Parse(DateTime.Now.AddYears(5).Year.ToString() + "-" + DateTime.Now.AddMonths(1).Month.ToString("D2") + "-01").AddDays(-1); e.NewValues["data_koncowa"] = dataKoncz; //d_zawieszenia e.NewValues["d_zawieszenia"] = DateTime.Now; e.NewValues["dataKoncaZawieszenia"] = dataKoncz; string idOsoby = cl.dodaj_osobe(2, 0); Session["idMediatora"] = idOsoby; Session["id_osoby"] = idOsoby; }
protected void trlDepartamentos_InitNewNode(object sender, ASPxDataInitNewRowEventArgs e) { // int intCodigo = new ClsGeneral().ObtenerNuevoCodigo((DataTable)Session[Constantes.SesionTablaDepartamentos], Constantes.ColumnaDepartamentoCodigo); if (trlDepartamentos.FocusedNode != null) { string strParentKey = trlDepartamentos.FocusedNode.Key; // e.NewValues[Constantes.ColumnaDepartamentoCodigo] = intCodigo; if (e.NewValues.Count > 0) { e.NewValues[Constantes.ColumnaDepartamentoPadre] = strParentKey; trlDepartamentos.StartEditNewNode(strParentKey); } } }
protected virtual void OnInitNewRow_BaseImplementation(ASPxDataInitNewRowEventArgs e) { if (SettingsText.InitNewRow.CommandUpdate.IsNotEmpty()) { SettingsText.CommandUpdate = SettingsText.InitNewRow.CommandUpdate.Truncate( SettingsText.InitNewRow.CommandUpdateWidth ); } if (SettingsText.InitNewRow.PopupEditFormCaption.IsNotEmpty()) { SettingsText.PopupEditFormCaption = SettingsText.InitNewRow.PopupEditFormCaption.Truncate( SettingsText.InitNewRow.PopupEditFormCaptionWidth ); } if (this.IsGrouped()) { var lastCallbackOfNewButton = CommandButtonCallbackRegistrator.InCallbacks().FindLastOf(ColumnCommandButtonType.New); if (lastCallbackOfNewButton != null) { var dataSourceIndex = lastCallbackOfNewButton.VisibleIndex; var dataSource = this.GetItem(dataSourceIndex); if (dataSource != null) { var propertyNames = this.GroupFieldNames(); var groupPropertyValues = dataSource.FetchPropertyValues(propertyNames); e.NewValues.Include(groupPropertyValues); } } } if (this.IsFiltered()) { e.NewValues.Include(FilterExpression.FetchPropertyValues()); } }
protected void grid_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { e.NewValues["ExpenseDate"] = DateTime.Now; e.NewValues["ExpenseUser"] = SlxContext.Instance.CurrentUserId; e.NewValues["ProjectID"] = GetDefaultProject(); e.NewValues["AccountID"] = GetDefaultAccount(); e.NewValues["Amount"] = 0; e.NewValues["Currency"] = SlxContext.Instance.User.COUNTRY; }
protected void grid_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { e.NewValues["ROL_NAME"] = "TZB_Admin"; }
protected void grid_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { ASPxGridView grid = new ASPxGridView(); e.NewValues["Id"] = grid.GetHashCode(); }
protected void gvColors_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { ((GridViewDataColumn)gvColors.Columns["Ejemplo"]).EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.False; }
protected void treeList_InitNewNode(object sender, ASPxDataInitNewRowEventArgs e) { e.NewValues["CRE_DATE"] = DateTime.Now; }
/// <summary> /// Khoi tao danh sach cac ngay trong tuan /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gridRoster_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { try { // Lay danh sach weekday va bind vao checkbox list var grid = sender as ASPxGridView; if (grid == null) { return; } var chkWeekday = grid.FindEditFormTemplateControl("chkWeekday") as CheckBoxList; var lstWeekday = JsonConvert.DeserializeObject<List<ConstantKeyValue>>(Constants.Weekdays); if (chkWeekday == null) { return; } chkWeekday.DataSource = lstWeekday; chkWeekday.DataTextField = "key"; chkWeekday.DataValueField = "key"; chkWeekday.DataBind(); } catch (Exception ex) { LoggerController.WriteLog(System.Runtime.InteropServices.Marshal.GetExceptionCode(), ex, Network.GetIpClient()); } }
protected virtual void OnInitNewRow_BaseImplementation(ASPxDataInitNewRowEventArgs e) { if (SettingsText.InitNewRow.CommandUpdate.IsNotEmpty()) { SettingsText.CommandUpdate = SettingsText.InitNewRow.CommandUpdate.Truncate( SettingsText.InitNewRow.CommandUpdateWidth ); } if (SettingsText.InitNewRow.PopupEditFormCaption.IsNotEmpty()) { SettingsText.PopupEditFormCaption = SettingsText.InitNewRow.PopupEditFormCaption.Truncate( SettingsText.InitNewRow.PopupEditFormCaptionWidth ); } if (this.IsGrouped()) { var lastCallbackOfNewButton = CommandButtonCallbackRegistrator.InCallbacks().FindLastOf(ColumnCommandButtonType.New); if (lastCallbackOfNewButton != null) { var dataSourceIndex = lastCallbackOfNewButton.VisibleIndex; var dataSource = this.GetItem(dataSourceIndex); if (dataSource != null) { var propertyNames = this.GroupFieldNames(); var groupPropertyValues = dataSource.FetchPropertyValues(propertyNames); e.NewValues.Include(groupPropertyValues); } } } if (this.IsFiltered()) { e.NewValues.Include(FilterExpression.FetchPropertyValues()); } }
/// <summary> /// Loc bot cac role da co cua user khi tao moi 1 role /// Tam bo, ko xai /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gridUserRole_OnInitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { try { // Get current grid user role var grid = sender as ASPxGridView; if (grid == null) { WebCommon.AlertGridView(sender, "Cannot find user role."); return; } int count; string username = grid.GetMasterRowKeyValue().ToString(); // Lay cot co chua id var commandColumn = grid.Columns["Role"] as GridViewDataComboBoxColumn; // Neu khong co cot do thi khong can lam tiep if (commandColumn == null) return; var cboRole = (ASPxComboBox)grid.FindEditFormTemplateControl("cboUserRole"); TList<Role> roles = DataRepository.RoleProvider.GetPaged("IsDisabled='false'", "", 0, 0, out count); TList<UserRole> userRoles = DataRepository.UserRoleProvider.GetPaged(string.Format("IsDisabled='false' and Username='******'", username), "", 0, 0, out count); var availableRoles = roles.FindAll(role => !userRoles.Exists(role2 => role.Id == role2.RoleId)); cboRole.DataSource = availableRoles; cboRole.DataBindItems(); } catch (Exception ex) { LoggerController.WriteLog(System.Runtime.InteropServices.Marshal.GetExceptionCode(), ex, Network.GetIpClient()); WebCommon.AlertGridView(this, "System is error. Please contact Administrator."); } }
protected override void RaiseInitNewRow(ASPxDataInitNewRowEventArgs e) { OnInitNewRow_BaseImplementation(e); base.RaiseInitNewRow(e); }
protected void gvcontacto_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { e.NewValues["Active"] = "Y"; }
protected void gvProductTypes_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { ((GridViewDataColumn)gvProductTypes.Columns["Categoría Talla"]).EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.True; }
public void DefaultUpdateRowInitializeFields(ASPxDataInitNewRowEventArgs e) { e.NewValues["UpdatedBy"] = UtilitySystem.CurrentUserName; e.NewValues["UpdatedDateTime"] = DateTime.UtcNow; }
public static void gvcrud_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { Debug.WriteLine(" ***** grid_InitNewRow"); }
protected override void RaiseInitNewRow(ASPxDataInitNewRowEventArgs e) { OnInitNewRow_BaseImplementation(e); base.RaiseInitNewRow(e); }
protected void GridView_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { ASPxGridView grid = sender as ASPxGridView; grid.ScrollToVisibleIndexOnClient = 0; }
protected void grid_InitNewRow(object sender, ASPxDataInitNewRowEventArgs e) { e.NewValues["CreateDateTime"] = DateTime.Now; }