public virtual void MouseUp(MouseControllerEventArgs e) { Internalmovdir = MoveDir; BackUpCellValues.Clear(); CellData = new GridCellData(); for (int Row = Gridmodel.SelectedCells.Top; Row <= Gridmodel.SelectedCells.Bottom; Row++) { for (int Column = this.SelectedRange.Left; Column <= this.SelectedRange.Right; Column++) { var CellRowColumnIndex = new RowColumnIndex(Row, Column); GridStyleInfoStore styleinfostore = (GridStyleInfoStore)this.grid.Model[Row, Column].Store.Clone(); //this.CellData[this.grid.Model[Row, Column].CellRowColumnIndex] = styleinfostore; BackUpCellValues.Add(CellRowColumnIndex, styleinfostore);//this.CellData[this.grid.Model[Row, Column].CellRowColumnIndex]); } } this.InnerFillType = SeriesType.FillSeries; this.FillData(); MoveDir = MovingDirection.None; IsMouseDown = false; #if !SILVERLIGHT if (Buttonside == MouseButton.Left) #else if (Buttonside == MouseButtons.Left) #endif { OpenFilterDropDown(); } }
public GridStyleInfo this[int rowIndex, int colIndex] { get { GridStyleInfo style = _dataCache[rowIndex, colIndex]; if (style == null) { GridStyleInfoStore store = _gridModel.Data[rowIndex, colIndex]; if (store == null) { store = new GridStyleInfoStore(); if (rowIndex <= _gridModel.Data.RowCount && colIndex <= _gridModel.Data.ColCount) { _gridModel.Data[rowIndex, colIndex] = store; } } style = new GridStyleInfo(new GridStyleInfoIdentity(this, rowIndex, colIndex), store); GC.SuppressFinalize(style.Identity); _dataCache.RowCount = Math.Max(rowIndex, _gridModel.Data.RowCount); _dataCache.ColCount = Math.Max(colIndex, _gridModel.Data.ColCount); _dataCache[rowIndex, colIndex] = style; } return(style); } set { GridStyleInfo style = _dataCache[rowIndex, colIndex]; if (!Object.ReferenceEquals(style, value)) { this[rowIndex, colIndex].ModifyStyle(value, StyleModifyType.Changes); } _gridModel.Data[rowIndex, colIndex] = value.Store; } }
public GridStyleInfo this[int rowIndex, int colIndex] { get { GridStyleInfo style = _dataCache[rowIndex, colIndex]; if (style == null) { if (rowIndex > _gridModel.Data.RowCount) { _gridModel.Data.RowCount = this.RowCount; } if (colIndex > _gridModel.Data.ColCount) { _gridModel.Data.ColCount = this.ColCount; } GridStyleInfoStore store = _gridModel.Data[rowIndex, colIndex]; if (store == null) { store = new GridStyleInfoStore(); _gridModel.Data[rowIndex, colIndex] = store; } style = new GridStyleInfo(new GridStyleInfoIdentity(this, rowIndex, colIndex), store); style.BeginInit(); GC.SuppressFinalize(style.Identity); GridQueryCellInfoEventArgs e = new GridQueryCellInfoEventArgs(rowIndex, colIndex, style); this._gridModel.RaiseQueryCellInfo(e); _dataCache.RowCount = _gridModel.Data.RowCount; _dataCache.ColCount = _gridModel.Data.ColCount; _dataCache[rowIndex, colIndex] = e.Style; style.EndInit(); } return(style); } set { GridStyleInfo style = _dataCache[rowIndex, colIndex]; if (!Object.ReferenceEquals(style, value)) { this[rowIndex, colIndex].ModifyStyle(value, StyleModifyType.Changes); } _gridModel.Data[rowIndex, colIndex] = value.Store; } }
private static void InitSortKeys(GridControl grid, int sortedColumnIndex, ListSortDirection sortDirection) { sortKeys = new List <SortKey>(); sortKeys.Clear(); for (int i = 1; i < grid.Model.RowCount; ++i) { GridStyleInfoStore o = grid.Model.Data[i, sortedColumnIndex]; sortKeys.Add(new SortKey { RowIndex = i, Value = (o == null) ? null : o.GetValue(GridStyleInfoStore.CellValueProperty) as IComparable }); } sortKeys.Sort(new SortComparer(sortDirection)); grid.InvalidateCells(); grid.InvalidateVisual(); }