Ejemplo n.º 1
0
        /// <summary>
        /// Method to Initalize the Grid Control, assign a Data Source and Main View to it, assign Value Change and Value Editor Methods
        /// </summary>

        #region Grid Control Initializer

        private void InitializeGridControls(int _noOfColumns, string _bandName, string _columnName1, string _columnName2, GridControl _gridControl, DataTable _dataSource, CustomBandedGridView _bandedGridView, bool Coordinate, Kinematics_Software_New _r)
        {
            float fontSize = 11;

            _bandedGridView             = CustomBandedGridView.CreateNewBandedGridView(0, _noOfColumns, _bandName);
            _gridControl.BindingContext = new BindingContext();
            _gridControl.DataSource     = null;
            _gridControl.ForceInitialize();
            _gridControl.DataSource           = _dataSource;
            _gridControl.MainView             = _bandedGridView;
            _bandedGridView.CellValueChanged += BandedGrid_LoadCase_CellValueChanged;
            _bandedGridView.ValidatingEditor += BandedGrid_LoadCase_ValidatingEditor;

            FontFamily LoadCaseFont = new FontFamily("Tahoma");

            _bandedGridView.Appearance.Row.Font = new Font(LoadCaseFont, fontSize);
            if (!Coordinate)
            {
                _bandedGridView = CustomBandedGridColumn.ColumnEditor_ForLoadCases(_bandedGridView, _columnName1, _columnName2);
            }
            else
            {
                _bandedGridView = CustomBandedGridColumn.ColumnEditor_ForSuspension(_bandedGridView, _r);
            }
        }
Ejemplo n.º 2
0
        public static CustomGridBand CreateNewGridBand(int _NoOfColumns, string _BandName)
        {
            _band              = new CustomGridBand();
            _band.Name         = _BandName;
            _band.Caption      = _BandName;
            _band.AutoFillDown = true;

            _band.AppearanceHeader.Options.UseFont = true;
            _band.AppearanceHeader.FontStyleDelta  = FontStyle.Bold;

            _band.AppearanceHeader.Options.UseTextOptions = true;
            _band.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            _band.AppearanceHeader.FontSizeDelta          = 1;

            _band.OptionsBand.AllowSize = true;

            for (int i_NoOfColumns = 0; i_NoOfColumns < _NoOfColumns; i_NoOfColumns++)
            {
                _band.Columns.Add(CustomBandedGridColumn.CreateNewColumn("Column " + (i_NoOfColumns + 1)));
            }



            return(_band);
        }
        public static CustomBandedGridColumn CreateNewColumn(string colName)
        {
            tire_band_column      = new CustomBandedGridColumn();
            tire_band_column.Name = colName;
            tire_band_column.BestFit();


            return(tire_band_column);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Method to initialize the <see cref="bandedGridView1"/>, set the <see cref="GridControl.DataSource"/> and perform some conditioning for the <see cref="GridControl.MainView"/> (which is the <see cref="bandedGridView1"/>)
        /// </summary>
        /// <param name="_legendDataTable"><see cref="DataTable"/> of the Legend</param>
        private void GridControlConditioning(DataTable _legendDataTable)
        {
            ///<summary> Initializing the <see cref="bandedGridView1"/> </summary>
            bandedGridView1 = CustomBandedGridView.CreateNewBandedGridView(0, 3, "Legend Data");

            ///<summary>Setting the DataSource and MainView of the <see cref="gridControl1"/></summary>
            GridControlConditioning_SetDataSource();

            ///<summary>Conditioning the Columns of the BandedGridView </summary>
            bandedGridView1 = CustomBandedGridColumn.ColumnEditor_ForLegend(bandedGridView1);

            ///<summary>Assigning the Colour Column of the Legend with the <see cref="repositoryItemColorPickEdit1"/> so that it displayes the colours from the <see cref="LegendDataTable"/></summary>
            bandedGridView1.Columns[2].ColumnEdit = repositoryItemColorPickEdit1;
        }
        /// <summary>
        /// Method to assign the <see cref="gridControlHeatMap"/> Data Source, Main View and Paint the Heat Map
        /// </summary>
        /// <param name="noOfColumns"></param>
        /// <param name="outputChannel"></param>
        private void DrawHeatMap(int noOfColumns, string outputChannel)
        {
            BatchRunGUI.bandedGridViewBatchRun = CustomBandedGridView.CreateNewBandedGridView(0, noOfColumns, outputChannel + " Heat Map");

            gridControlHeatMap.DataSource = HeatMapDataSource;

            gridControlHeatMap.MainView = BatchRunGUI.bandedGridViewBatchRun;

            BatchRunGUI.bandedGridViewBatchRun = CustomBandedGridColumn.ColumnEditor_ForHeatMapControl(BatchRunGUI.bandedGridViewBatchRun);

            ConditionHeatMap(OutputMode);

            BatchRunGUI.bandedGridViewBatchRun.Columns[1].SortOrder = DevExpress.Data.ColumnSortOrder.Descending;
        }
Ejemplo n.º 6
0
 public void InitializeGridControl_MotionView(int Index, Kinematics_Software_New _r1)
 {
     try
     {
         r1 = _r1;
         int guiIndex = Vehicle.List_Vehicle[Index].vehicle_Motion.MotionID - 1;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion = CustomBandedGridView.CreateNewBandedGridView(guiIndex, 3, "Motion View");
         _r1.gridControl2.DataSource = Vehicle.List_Vehicle[Index].vehicle_Motion.Motion_DataTable;
         _r1.gridControl2.MainView   = MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion.FocusedRowChanged += BandedGridView_Motion_FocusedRowChanged;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion.OptionsNavigation.EnterMoveNextColumn = true;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion.OptionsNavigation.AutoMoveRowFocus    = true;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion.OptionsNavigation.AutoFocusNewRow     = true;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion = CustomBandedGridColumn.ColumnEditor_ForMotion(MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion, _r1);
     }
     catch (Exception)
     {
         // If I open a project which has no motion but has a vehicle then this function will be called on account of the fact that the there exists a Vehicle. At that point, this method will fail because the guiIndex will be -1. SO to allow the remaining
         // open function to continue, this TryCatch block exists
     }
 }
Ejemplo n.º 7
0
 public void GridControlDataSource(GridControl _gridControl, DataTable _dataTable, CustomBandedGridView _bandedGridview, Kinematics_Software_New _R1)
 {
     _gridControl.DataSource = _dataTable;
     _bandedGridview         = CustomBandedGridColumn.ColumnEditor_ForSuspension(_bandedGridview, _R1);
 }