protected bool TryMerge(CellEditor container, EditGridCellData cellData, int curIndex) { int mergCount = 0; TableView view = (TableView)cellData.View; GridControl grid = view.Grid; double width = 0; for (int i = cellData.Column.VisibleIndex + 1; i < view.VisibleColumns.Count; i++) { var c = view.VisibleColumns[i]; if (object.Equals(grid.GetCellValue(curIndex, c), cellData.Value)) { width += c.ActualDataWidth; } else { break; } } container.Margin = new Thickness(0, 0, -width, 0); return(true); }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { CellEditor cellEditor = container as CellEditor; EditGridCellData cellData = item as EditGridCellData; TableView view = cellData.View as TableView; TryMerge(cellEditor, cellData, view.Grid.GetRowVisibleIndexByHandle(cellData.RowData.RowHandle.Value)); return(base.SelectTemplate(item, container)); }
private CellEditor _GetAddressColumnEditor(AddressPart addressPart) { string keyName = string.Format(ADDRESS_COLUMN_EDITOR_KEY_FORMAT, addressPart.ToString()); CellEditor editor = (CellEditor)App.Current.FindResource(keyName); Debug.Assert(editor != null); return(editor); }
protected override CellEditor GetCellEditor() { // if current column is "Name" return custom editor if (this.FieldName.CompareTo("Name") == 0) { CellEditor routeNameEditor = (CellEditor)App.Current.FindResource("InsertionRowRouteNameEditor"); return(routeNameEditor); } // otherwise return default editor return(base.GetCellEditor()); }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { CellEditor cellEditor = container as CellEditor; EditGridCellData cellData = item as EditGridCellData; if (cellData.Column.FieldName != "ID1") { cellEditor.Margin = new Thickness(0, 0, 0, 0); return(base.SelectTemplate(item, container)); } TableView view = cellData.View as TableView; TryMerge(cellEditor, cellData, view.Grid.GetRowVisibleIndexByHandle(cellData.RowData.RowHandle.Value)); return(base.SelectTemplate(item, container)); }
protected bool TryMerge(CellEditor container, EditGridCellData cellData, int curIndex) { TableView view = (TableView)cellData.View; GridControl grid = view.Grid; var curI = cellData.Column.VisibleIndex + 1; double width = 0; for (int i = curI; i < view.VisibleColumns.Count; i++) { var c = view.VisibleColumns[i - 1]; var a = grid.GetCellValue(curIndex, c) as DynamicTableModel; if (a.IsBorerNull) { width += c.ActualDataWidth; } else { break; } } container.Margin = new Thickness(0, 0, -width, 0); return(true); }
private static void DownloadAll() { var downloader = new Action <float>[] { (p) => Download(typeof(MasterDataItem), p, m => ItemEditor.Load(m.Item), false), (p) => Download(typeof(MasterDataCell), p, m => CellEditor.Load(m.Cell), false), (p) => Download(typeof(MasterDataCellEvent), p, m => CellEventEditor.Load(m.CellEvent), false), (p) => Download(typeof(MasterDataLevelUpCost), p, m => LevelUpCostEditor.Load(m.LevelUpCost), false), (p) => Download(typeof(MasterDataHousingLevelParameter), p, m => HousingLevelParameterEditor.Load(m.HousingLevelParameter), false), (p) => Download(typeof(MasterDataFacilityLevelParameter), p, m => FacilityLevelParameterEditor.Load(m.FacilityLevelParameter), false), (p) => Download(typeof(MasterDataRoadLevelParameter), p, m => RoadLevelParameterEditor.Load(m.RoadLevelParameter), false), (p) => Download(typeof(MasterDataUnlockCellEvent), p, m => UnlockCellEventEditor.Load(m.UnlockCellEvent), false), (p) => Download(typeof(MasterDataCellBundle), p, m => CellBundleEditor.Load(m.CellBundle), false), (p) => Download(typeof(MasterDataUnlockCellBundle), p, m => UnlockCellBundleEditor.Load(m.UnlockCellBundle), false), }; for (var i = 0; i < downloader.Length; i++) { var progress = (float)i / downloader.Length; downloader[i](progress); } EditorUtility.ClearProgressBar(); }
private static void DownloadCell() { Download(typeof(MasterDataCell), 1.0f, m => CellEditor.Load(m.Cell)); }