예제 #1
0
 /// <summary>
 /// Constructor. Create a DataGridColumn class.
 /// </summary>
 /// <param name="grid"></param>
 public DataGridColumn(DataGrid grid)
     : base(grid)
 {
     mHeaderCell = new Cells.DataGrid.ColumnHeader(string.Empty);
     mDataCell   = new Cells.DataGrid.Cell();
 }
예제 #2
0
		/// <summary>
		/// Constructor. Create a DataGridColumn class.
		/// </summary>
		/// <param name="grid"></param>
		public DataGridColumn(DataGrid grid)
			: base(grid)
		{
			mHeaderCell = new Cells.DataGrid.ColumnHeader(string.Empty);
			mDataCell = new Cells.DataGrid.Cell();
		}
예제 #3
0
        /// <summary>
        /// Easy method to add a new Text column.
        ///
        /// </summary>
        /// <param name="AColumnTitle">Title of the HeaderColumn</param>
        /// <param name="ADataColumn">DataColumn to which this column should be DataBound</param>
        /// <param name="AColumnWidth">Column width in pixels (-1 for automatic width)</param>
        /// <param name="AController"></param>
        /// <param name="AEditor">An instance of an Editor (based on ICellVirtual.Editor)</param>
        /// <param name="AModel"></param>
        /// <param name="AView"></param>
        /// <param name="AConditionView"></param>
        ///
        /// <returns>void</returns>
        public void AddTextColumn(String AColumnTitle,
            DataColumn ADataColumn,
            Int16 AColumnWidth,
            ControllerBase AController,
            EditorBase AEditor,
            ModelContainer AModel,
            IView AView,
            SourceGrid.Conditions.ConditionView AConditionView)
        {
            SourceGrid.Cells.ICellVirtual ADataCell;
            SourceGrid.DataGridColumn AGridColumn;

            if (ADataColumn == null)
            {
                throw new ArgumentNullException("ADataColumn", "ADataColumn must not be nil!");
            }

            ADataCell = new SourceGrid.Cells.DataGrid.Cell();

            if (AController != null)
            {
                MessageBox.Show("AController <> nil!");
                try
                {
                    ADataCell.AddController(AController);
                }
                catch (Exception Exp)
                {
                    MessageBox.Show("TSgrdDataGrid.AddTextColumn: Exeption: " + Exp.ToString());
                }
            }

            if (AEditor != null)
            {
                ADataCell.Editor = AEditor;
            }

            if (AModel != null)
            {
                ADataCell.Model = AModel;
            }

            if (AView != null)
            {
                ADataCell.View = AView;
            }

            AGridColumn = new TSgrdTextColumn(this, ADataColumn, AColumnTitle, ADataCell, AColumnWidth, FSortableHeaders);

            if (AConditionView != null)
            {
                AGridColumn.Conditions.Add(AConditionView);
            }

            this.Columns.Insert(this.Columns.Count, AGridColumn);
        }