protected void grdBooking_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e) { grdBooking.Selection.SelectRowByKey(Guid.Parse(e.NewValues["TransactionId"].ToString())); grdBooking.DetailRows.CollapseAllRows(); grdBooking.DetailRows.ExpandRowByKey(Guid.Parse(e.NewValues["TransactionId"].ToString())); int position = grdBooking.FindVisibleIndexByKeyValue(Guid.Parse(e.NewValues["TransactionId"].ToString())); ASPxGridView grdBooking_Detail = (ASPxGridView)grdBooking.FindDetailRowTemplateControl(position, "grdBookingDetail"); grdBooking_Detail.AddNewRow(); grdBooking_Detail.Focus(); grdBooking.FocusedRowIndex = position; }
protected void grdCreator_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { ASPxGridView grid = sender as ASPxGridView; //MRPClass.PrintString(e.Parameters.ToString()); if (e.Parameters == "AddNew") { if (grdBUSSU.VisibleRowCount == 0) { return; } bool parseInt = int.TryParse(grdBUSSU.GetRowValues(grdBUSSU.FocusedRowIndex, "PK").ToString(), out iBUSSUMasterKey); if (parseInt == false) { return; } if (iBUSSUMasterKey == 0) { return; } bindCreatorList = false; sBUSSUCreatorKey = ""; grid.AddNewRow(); } if (e.Parameters == "Creator") { int iMaster = 0; if (grdBUSSU.VisibleRowCount > 0) { iMaster = Convert.ToInt32(grdBUSSU.GetRowValues(grdBUSSU.FocusedRowIndex, "PK").ToString()); } grid.CancelEdit(); MRPClass.PrintString(iMaster.ToString()); BindBUSSUListCreator(iMaster); } }
protected void grdBooking_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e) { grdBooking.Selection.SelectRowByKey(Guid.Parse(e.NewValues["TransactionId"].ToString())); grdBooking.DetailRows.CollapseAllRows(); grdBooking.DetailRows.ExpandRowByKey(Guid.Parse(e.NewValues["TransactionId"].ToString())); int position = grdBooking.FindVisibleIndexByKeyValue(Guid.Parse(e.NewValues["TransactionId"].ToString())); ASPxGridView grdBooking_Detail = (ASPxGridView)grdBooking.FindDetailRowTemplateControl(position, "grdBookingDetail"); grdBooking_Detail.AddNewRow(); grdBooking_Detail.Focus(); grdBooking.FocusedRowIndex = position; //grdBooking.JSProperties.Add("cpRefresh", "refresh"); //NAS.DAL.Accounting.AccountChart.Account account = session.GetObjectByKey<NAS.DAL.Accounting.AccountChart.Account>(Guid.Parse(e.NewValues["AccountId!Key"].ToString())); //GeneralJournal generalJournal = session.GetObjectByKey<GeneralJournal>(Guid.Parse(e.NewValues["GeneralJournalId"].ToString())); //General general = new General(); //general.BalanceUpdate(session, account, generalJournal, false, double.Parse(e.NewValues["Debit"].ToString()) - double.Parse(e.NewValues["Credit"].ToString())); }