private void timer1_Tick(object sender, EventArgs e) { try { HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory(); if (this.LadeAssignmentDataTable == null || this.StartIndex >= this.LadeAssignmentDataTable.Rows.Count || StartIndex == 0) { LadeAssignmentDataTable = new DataTable(); LadeAssignmentFactory.GetAllActives(ref LadeAssignmentDataTable, _LaderTypesID_nvc); this.StartIndex = 0; } if (this.LadeAssignmentDataTable != null && this.LadeAssignmentDataTable.Rows.Count > 0) { this.dataGridView1.Rows.Clear(); for (int index = this.StartIndex; index < Math.Min(this.StartIndex + 5, this.LadeAssignmentDataTable.Rows.Count); index++) { this.dataGridView1.Rows.Add(); DataGridViewRow row = this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1]; //row.Cells[this.colOrder_int.Name].Value = LadeAssignmentDataTable.Rows[index]["Order_int"]; row.Cells[this.colLaderType_nvc.Name].Value = LadeAssignmentDataTable.Rows[index]["LaderType_nvc"]; row.Cells[this.colCarCount_int.Name].Value = LadeAssignmentDataTable.Rows[index]["CarCount_int"]; row.Cells[this.colCity_nvc.Name].Value = LadeAssignmentDataTable.Rows[index]["City_nvc"]; row.Cells[this.colGood_nvc.Name].Value = LadeAssignmentDataTable.Rows[index]["Good_nvc"]; //row.Cells[this.colWeight_flt.Name].Value = LadeAssignmentDataTable.Rows[index]["Weight_dec"]; row.Cells[this.colPortageFee_dec.Name].Value = LadeAssignmentDataTable.Rows[index]["PortageFee_dec"]; //row.Cells[this.colComment_nvc.Name].Value = LadeAssignmentDataTable.Rows[index]["Comment_nvc"]; row.Cells[this.colBoxingType_nvc.Name].Value = LadeAssignmentDataTable.Rows[index]["BoxingType_nvc"]; row.Cells[this.colCompany_nvc.Name].Value = LadeAssignmentDataTable.Rows[index]["Company_nvc"]; row.Cells[this.colRemainedCount_int.Name].Value = LadeAssignmentDataTable.Rows[index]["RemainedCount_int"]; row.Cells[this.colLadBillCount_int.Name].Value = LadeAssignmentDataTable.Rows[index]["LadBillCount_int"]; } this.dataGridView1.Update(); this.StartIndex += 5; if (StartIndex >= this.LadeAssignmentDataTable.Rows.Count) { this.StartIndex = 0; } } else { this.dataGridView1.Rows.Clear(); } } catch (Exception ex) { } }