public override void PopulateData() { try { using (TaxiDataContext db = new TaxiDataContext()) { var list = db.stp_GetLastCompanyInvoice().OrderBy(item => item.CompanyName, new NaturalSortComparer <string>()).ToList(); grdDriverRentLastStatement.BeginUpdate(); grdDriverRentLastStatement.RowCount = list.Count; for (int i = 0; i < list.Count; i++) { grdDriverRentLastStatement.Rows[i].Cells[COLS.Id].Value = list[i].Id; grdDriverRentLastStatement.Rows[i].Cells[COLS.DriverId].Value = list[i].CompanyId; grdDriverRentLastStatement.Rows[i].Cells[COLS.DriverNo].Value = list[i].CompanyCode; grdDriverRentLastStatement.Rows[i].Cells[COLS.DriverName].Value = list[i].CompanyName; grdDriverRentLastStatement.Rows[i].Cells[COLS.TransDate].Value = list[i].InvoiceDate; grdDriverRentLastStatement.Rows[i].Cells[COLS.TransNo].Value = list[i].InvoiceNo; //grdDriverRentLastStatement.Rows[i].Cells[COLS.JobsTotal].Value = list[i].JobsTotal; //grdDriverRentLastStatement.Rows[i].Cells[COLS.OldBalance].Value = list[i].OldBalance; grdDriverRentLastStatement.Rows[i].Cells[COLS.FromDate].Value = list[i].FromDate; grdDriverRentLastStatement.Rows[i].Cells[COLS.ToDate].Value = list[i].TillDate; grdDriverRentLastStatement.Rows[i].Cells[COLS.Balance].Value = list[i].InvoiceTotal; //grdDriverRentLastStatement.Rows[i].Cells[COLS.JobsTotal].Value = list[i].Id; } grdDriverRentLastStatement.EndUpdate(); } } catch (Exception ex) { ENUtils.ShowMessage(ex.Message); } }