예제 #1
0
	        public static ICellVirtual Create(Type type, bool editable)
	        {
	            ICellVirtual cell;
	
	            if (type == typeof(bool))
	                cell = new SourceGrid.Extensions.PingGrids.Cells.CheckBox();
	            else
	            {
	                cell = new SourceGrid.Extensions.PingGrids.Cells.Cell();
	                cell.Editor = SourceGrid.Cells.Editors.Factory.Create(type);
	            }
	
	            if (cell.Editor != null) //Can be null for special DataType like Object
	            {
	                //The columns now support always DbNull values because the validation is done at row level by the DataTable itself.
	                cell.Editor.AllowNull = true;
	                cell.Editor.EnableEdit = editable;
	            }
	
	            return cell;
	        }
예제 #2
0
        public static ICellVirtual Create(Type type, bool editable)
        {
            ICellVirtual cell;

            if (type == typeof(bool))
            {
                cell = new SourceGrid.Extensions.PingGrids.Cells.CheckBox();
            }
            else
            {
                cell        = new SourceGrid.Extensions.PingGrids.Cells.Cell();
                cell.Editor = SourceGrid.Cells.Editors.Factory.Create(type);
            }

            if (cell.Editor != null)         //Can be null for special DataType like Object
            {
                //The columns now support always DbNull values because the validation is done at row level by the DataTable itself.
                cell.Editor.AllowNull  = true;
                cell.Editor.EnableEdit = editable;
            }

            return(cell);
        }