Beispiel #1
0
        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 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";
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }