private void FillColumns(DetailConfiguration detail, CremaDataTable table) { try { detail.Columns.Add(new Column() { FieldName = CremaSchema.Index, ReadOnly = true, Width = 50, Title = nameof(CremaSchema.Index) }); #if DEBUG detail.Columns.Add(new Column() { FieldName = CremaSchema.__ParentID__, ReadOnly = true, }); #endif detail.Columns.Add(this.FindResource("tagColumn") as ColumnBase); detail.Columns.Add(this.FindResource("enableColumn") as ColumnBase); foreach (var item in table.Columns) { var column = new Column() { FieldName = item.ColumnName, }; this.InitializeColumn(item, column); detail.Columns.Add(column); } detail.Columns.Add(this.FindResource("modifierColumn") as ColumnBase); detail.Columns.Add(this.FindResource("modifiedDateTimeColumn") as ColumnBase); detail.Columns.Add(this.FindResource("creatorColumn") as ColumnBase); detail.Columns.Add(this.FindResource("createdDateTimeColumn") as ColumnBase); var firstPrimaryKeyColumnIndex = FirstPrimaryKeyColumnIndex(detail.VisibleColumns, table.PrimaryKey); if (firstPrimaryKeyColumnIndex >= 0) { detail.SetValue(TableView.FixedColumnCountProperty, firstPrimaryKeyColumnIndex + 1); } } catch { throw new InvalidOperationException(); } }
private void FillColumns(DetailConfiguration detail, CremaDataTable table) { try { #if DEBUG detail.Columns.Add(new Column() { FieldName = CremaSchema.Index, ReadOnly = true }); detail.Columns.Add(new Column() { FieldName = CremaSchema.__ParentID__, ReadOnly = true, }); #endif detail.Columns.Add(this.FindResource("tagColumn") as ColumnBase); detail.Columns.Add(this.FindResource("enableColumn") as ColumnBase); foreach (var item in table.Columns) { var column = new Column() { FieldName = item.ColumnName, }; this.InitializeColumn(item, column); detail.Columns.Add(column); } detail.Columns.Add(this.FindResource("modifierColumn") as ColumnBase); detail.Columns.Add(this.FindResource("modifiedDateTimeColumn") as ColumnBase); detail.Columns.Add(this.FindResource("creatorColumn") as ColumnBase); detail.Columns.Add(this.FindResource("createdDateTimeColumn") as ColumnBase); detail.SetValue(TableView.FixedColumnCountProperty, 2 + table.PrimaryKey.Length); } catch { throw new InvalidOperationException(); } }
public static void SetReference(DetailConfiguration obj, object value) { obj.SetValue(ReferenceProperty, value); }