/// <summary> /// Change the color of selected rows to highlight them. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <remarks>Created: Theo Crous 28/08/2012</remarks> private void grvLines_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e) { DB.VW_Line FocusedRow = grvLines.GetRow(e.RowHandle) as DB.VW_Line; if (FocusedRow == null) { return; } if ((FocusedRow.IsReconned.HasValue && FocusedRow.IsReconned.Value)) { e.Appearance.BackColor = Color.FromArgb(249, 239, 187); } }
/// <summary> /// Gets the lineid for the current row that is selected /// </summary> /// <param name="headerid"></param> /// <remarks>Created: Jan de Bruyn 13/08/2012</remarks> public void SetLineId(Int64 lineid) { this.LineId = lineid; line = DataContext.ReadonlyContext.VW_Line.First(n => n.Id == LineId); }
/// <summary> /// Keeps track of which lines should be linked to current recon. /// </summary> /// <remarks>Created: Werner Scheffer 16/02/2012</remarks> private void grvLines_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { try { if (grvLines.FocusedRowHandle < 0) { return; } DB.VW_Line FocusedRow = grvLines.GetFocusedRow() as DB.VW_Line; DataAccessLayer.DB.GLX_Recon recon = (BindingSource.DataSource as DataAccessLayer.DB.GLX_Recon); if (FocusedRow.IsReconned.Value) { FocusedRow.ReconId = recon.Id; } else { FocusedRow.ReconId = null; } changeset.Add(FocusedRow.Id); RecalcLineTotal(); /* * * * * if (reconLines.Count() == 0) * { * PopulateReconLines(); * } * * if ((sender as DevExpress.XtraGrid.Views.Grid.GridView).FocusedColumn == colSelected) * { * //IF LINE IN RECON LINE LIST * if (reconLines.Where(n => n.Key == ((DB.VW_Line)grvLines.GetFocusedRow()).LineId).Count() > 0) * { * //UPDATE BOOL * reconLines[Convert.ToInt64(((DB.VW_Line)grvLines.GetFocusedRow()).LineId)] = Convert.ToBoolean(e.Value); * } * else * { * //ADD ITEM TO LIST * reconLines.Add(Convert.ToInt64(((DB.VW_Line)grvLines.GetFocusedRow()).LineId), Convert.ToBoolean(e.Value)); * } * } * ReconBalances();*/ } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }