public CompositeColumnsGroupcontrol(GridEXGroup group, GridEXTable table) { // This call is required by the Windows Form Designer. InitializeComponent(); mCompositeColumns = new List<GridEXColumn>(); this.CreateGridsTable(); if (group.Table != null) { this.Table = group.Table; } else { this.Table = table; } // Add any initialization after the InitializeComponent() call. this.mGroup = group; if (mGroup.CustomGroup != null) { this.CustomGroup = mGroup.CustomGroup; } else { GridEXCustomGroup newCustomGroup = new GridEXCustomGroup(); newCustomGroup.CustomGroupType = CustomGroupType.CompositeColumns; this.CustomGroup = newCustomGroup; mGroup.CustomGroup = newCustomGroup; } }
/// <summary> /// /// </summary> /// <param name="table"></param> /// <returns></returns> public static string GetFilterText(this GridEXTable table) { object emptyString = ""; if (table.FilterApplied != null && table.FilterApplied.Conditions.Count > 0) { return(Convert.ToString(table.FilterApplied.Conditions[0].Value1 ?? emptyString)); } return(string.Empty); }
public ColumnGroupControl(GridEXGroup group, GridEXTable table) { // This call is required by the Windows Form Designer. InitializeComponent(); this.mGroup = group; this.FillGroupIntervalCombo(); if (group.Column != null) { this.Table = group.Column.Table; } else if (group.Table != null) { this.Table = group.Table; } else { this.Table = table; } if (this.Table.ChildTables.Count > 0 || this.Table.ParentTable != null) { bool allowChildTables = false; if (this.Table.AllowChildTableGroups == InheritableBoolean.Default) { allowChildTables = this.Table.GridEX.AllowChildTableGroups; } else if (this.Table.AllowChildTableGroups == InheritableBoolean.True) { allowChildTables = true; } if (allowChildTables) { this.FillTablesCombo(); this.grbTable.Visible = true; if (this.Table.ChildTables.Count == 0) { this.cboTables.ReadOnly = true; } } else { this.grbTable.Visible = false; } } else { this.grbTable.Visible = false; } this.Column = group.Column; // Add any initialization after the InitializeComponent() call. }
private void AddChildTables(GridEXTable table, int indent) { Janus.Windows.EditControls.UIComboBoxItem item = new Janus.Windows.EditControls.UIComboBoxItem(table.Caption, table); item.ImageIndex = table.ImageIndex; item.IndentLevel = indent; this.cboTables.Items.Add(item); foreach (GridEXTable childTable in table.ChildTables) { this.AddChildTables(childTable, indent + 1); } }
private void FillTablesCombo() { this.cboTables.ImageList = mTable.GridEX.ImageList; GridEXTable rootTable= mTable; while (rootTable.ParentTable != null) { rootTable = rootTable.ParentTable; } this.AddChildTables(rootTable, 0); this.cboTables.SelectedValue = Table; }
private void InitGrid() { GridEXColumn col; var rt = new GridEXTable(); grdList.RootTable = rt; rt.Columns.Add("Name"); rt.Columns.Add("Field1"); rt.Columns.Add("Field2"); CssContext.Instance.Host.Personalisation.RestoreGridLayout("mygrid", grdList); }
private void CreateGridColumns() { GridEX1.ImageList = ImageList1; GridEX1.AllowAddNew = InheritableBoolean.True; GridEX1.AllowDelete = InheritableBoolean.True; GridEX1.EmptyRows = true; GridEX1.ColumnAutoResize = true; //Create a new GridEXTable GridEXTable table = new GridEXTable(); //add columns to the table //adding an unbound icon column GridEXColumn iconColumn = table.Columns.Add("Icon", ColumnType.Image, EditType.NoEdit); //set other properties iconColumn.Width = 22; iconColumn.Caption = ""; iconColumn.AllowSort = false; iconColumn.AllowGroup = false; iconColumn.AllowSize = false; iconColumn.Selectable = false; iconColumn.BoundMode = ColumnBoundMode.UnboundFetch; iconColumn.ImageKey = "TaskIcon"; //TaskIcon image is defined in ImageList1 //adding a checkbox column that will be bound to "Complete" DataColumn in the datasource GridEXColumn completeColumn = table.Columns.Add("Complete", ColumnType.CheckBox, EditType.CheckBox); completeColumn.Width = 24; completeColumn.AllowSize = false; completeColumn.Caption = ""; //adding a text column that will be bound to "Subject" DataColumn in the datasource GridEXColumn subjectColumn = table.Columns.Add("Subject", ColumnType.Text, EditType.TextBox); subjectColumn.Width = 250; //adding a CalendarCombo combo that will be bound to "DueDate" DataColumn in the datasource GridEXColumn dueDateColumn = table.Columns.Add("DueDate", ColumnType.Text, EditType.CalendarCombo); dueDateColumn.Width = 120; dueDateColumn.DefaultGroupInterval = GroupInterval.Date; dueDateColumn.FormatString = "d"; //use short date format //once all columns have been added to the GridEXTable, set the table as the RootTable of the grid GridEX1.RootTable = table; }
private void InitGrid() { GridEXColumn col; var rt = new GridEXTable(); col = rt.Columns.Add("DocumentID"); col.EditType = EditType.NoEdit; col.Selectable = false; col = rt.Columns.Add("Name"); col.EditType = EditType.NoEdit; col.Selectable = false; grdList.RootTable = rt; grdList.ColumnAutoResize = true; CssContext.Instance.Host.Personalisation.RestoreGridLayout("uniquestringforgrid", grdList); }
public ConditionalGroupControl(GridEXGroup group, GridEXTable table) { // This call is required by the Windows Form Designer. InitializeComponent(); if (group.Table != null) { this.mTable = group.Table; } else { this.mTable = table; } // Add any initialization after the InitializeComponent() call. this.FillCustomGroupsCombo(); this.Group = group; }
private void InitGrid() { GridEXColumn col; var rt = new GridEXTable(); rt.HierarchicalMode = HierarchicalMode.SelfReferencingChildList; rt.SelfReferencingSettings.ChildListMember = "Items"; col = rt.Columns.Add("Selected"); col.EditType = EditType.CheckBox; col.ColumnType = ColumnType.CheckBox; col = rt.Columns.Add("Name"); gridEX1.RootTable = rt; gridEX1.Hierarchical = true; gridEX1.ColumnHeaders = InheritableBoolean.False; gridEX1.VisualStyle = VisualStyle.Office2010; gridEX1.GroupByBoxVisible = false; gridEX1.UpdateMode = UpdateMode.CellUpdate; }
private void LoadGrid() { //Set GridEX in unbound mode this.gridEX1.BoundMode = BoundMode.Unbound; this.gridEX1.AllowAddNew = InheritableBoolean.True; this.gridEX1.AllowDelete = InheritableBoolean.True; this.gridEX1.RowHeaders = InheritableBoolean.True; //Create root table and columns GridEXTable gridTable = new GridEXTable(); //Assign the table as the root table of the grid gridEX1.RootTable = gridTable; GridEXColumn column; column = gridTable.Columns.Add("Id", ColumnType.Text); column.DataTypeCode = TypeCode.Int32; column = gridTable.Columns.Add("Name", ColumnType.Text); column.DataTypeCode = TypeCode.String; column = gridTable.Columns.Add("Date", ColumnType.Text, EditType.CalendarCombo); column.DataTypeCode = TypeCode.DateTime; column.DefaultValue = DateTime.Today; column.FormatString = "d"; }