public void BandedGridView_Motion_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { try { if (!r1.IsBeingOpened) { int outputIndex = 0, indexOfVehicle = 0; if (e.FocusedRowHandle >= 0) { outputIndex = e.FocusedRowHandle; } r1.FindOutPutIndex(outputIndex); foreach (NavBarGroup item in r1.navBarControlResults.Groups) { for (int i_Group = 0; i_Group < Kinematics_Software_New.M1_Global.vehicleGUI.Count; i_Group++) { if (r1.navBarControlResults.ActiveGroup.Name == Kinematics_Software_New.M1_Global.vehicleGUI[i_Group].navBarGroup_Vehicle_Result.Name) { indexOfVehicle = i_Group; goto A; } } } A: r1.PopulateOutputDataTable(Vehicle.List_Vehicle[indexOfVehicle]); r1.DisplayOutputs(Vehicle.List_Vehicle[indexOfVehicle]); Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].GridControlDataSource(Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].GridControlOutputs_SCFL, Vehicle.List_Vehicle[indexOfVehicle].oc_FL[outputIndex].OC_SC_DataTable, Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].ocGUI_FL.bandedGridView_Outputs, r1); Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].GridControlDataSource(Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].GridControlOutputs_SCFR, Vehicle.List_Vehicle[indexOfVehicle].oc_FR[outputIndex].OC_SC_DataTable, Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].ocGUI_FR.bandedGridView_Outputs, r1); Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].GridControlDataSource(Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].GridControlOutputs_SCRL, Vehicle.List_Vehicle[indexOfVehicle].oc_RL[outputIndex].OC_SC_DataTable, Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].ocGUI_RL.bandedGridView_Outputs, r1); Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].GridControlDataSource(Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].GridControlOutputs_SCRR, Vehicle.List_Vehicle[indexOfVehicle].oc_RR[outputIndex].OC_SC_DataTable, Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].ocGUI_RR.bandedGridView_Outputs, r1); r1.PopulateInputSheet(Vehicle.List_Vehicle[indexOfVehicle]); Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].EditORCreateVehicleCAD(Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].CADVehicleOutputs, indexOfVehicle, false, true, outputIndex, true, Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].CadIsTobeImported, Kinematics_Software_New.M1_Global.vehicleGUI[indexOfVehicle].PlotWheel); } } catch (Exception) { // Encountered a System.OutOfIndex Exception. } }