/// <summary> /// Loads the DataGrid using values obtained in the DataSet /// </summary> private void rtplnLoadList(DataRow[] dRows) { rtplntbFindName.Text = ""; rtplnLastSearchText = ""; rtplndgvHDClientList.Rows.Clear(); progressBar1.Value = 0; progressBar1.Show(); rtplntbFindName.Visible = rtplncboFilter.Visible = lblFilterBy.Visible = false; Application.DoEvents(); progressBar1.Maximum = dRows.Length; for (int i = 0; i < dRows.Length; i++) { rtplndgvHDClientList.Rows.Add(); rtplndgvHDClientList["clmCnt", i].Value = (i + 1).ToString(); rtplndgvHDClientList["clmRouteID", i].Value = true; rtplndgvHDClientList["clmRouteID", i].Value = dRows[i]["HDRoute"]; rtplndgvHDClientList["clmRouteTitle", i].Value = dRows[i]["RouteTitle"]; rtplndgvHDClientList["clmID", i].Value = dRows[i]["ID"]; rtplndgvHDClientList["clmName", i].Value = dRows[i]["Name"]; rtplndgvHDClientList["clmAddress", i].Value = dRows[i]["Address"].ToString() + "\r\n " + dRows[i]["City"].ToString() + ", " + dRows[i]["ZipCode"].ToString(); rtplndgvHDClientList["clmApt", i].Value = dRows[i]["AptNbr"]; rtplndgvHDClientList["clmPhone", i].Value = CCFBGlobal.FormatPhone(dRows[i]["Phone"].ToString()); rtplndgvHDClientList["clmFamilySize", i].Value = dRows[i]["FamilySize"]; rtplndgvHDClientList["clmComments", i].Value = dRows[i]["Comments"]; rtplndgvHDClientList["clmDriverNotes", i].Value = dRows[i]["DriverNotes"]; rtplndgvHDClientList["clmSvcItem", i].Value = dRows[i]["HDItem"]; rtplndgvHDClientList["clmLastSvc", i].Value = CCFBGlobal.ValidDateString(dRows[i]["LatestService"]); rtplndgvHDClientList[rtplnSortColName, i].Style.BackColor = Color.Azure; progressBar1.PerformStep(); } lblRowCnt.Text = "[ " + rtplndgvHDClientList.Rows.Count.ToString() + " ]"; rtplnrowIndex = 0; foreach (ToolStripButton tsb in toolStrip2.Items) { rtplndgvHDClientList.Columns[tsb.Tag.ToString()].Visible = tsb.Checked; } progressBar1.Value = 0; progressBar1.Visible = false; rtplntbFindName.Visible = true; if (rtplnFilterColName != "") { rtplnGetDistincts(rtplnFilterColName); } }
/// <summary> /// Loads the DataGrid using values obtained in the DataSet /// </summary> private void loadList() { tbFindName.Text = ""; lastSearchText = ""; dgvHD.Rows.Clear(); progressBar1.Value = 0; progressBar1.Show(); tbFindName.Visible = false; Application.DoEvents(); progressBar1.Maximum = rowCount; for (int i = 0; i < rowCount; i++) { dgvHD.Rows.Add(); dgvHD["clmRouteID", i].Value = true; dgvHD["clmRouteID", i].Value = dset.Tables[0].Rows[i]["HDRoute"]; dgvHD["clmRouteTitle", i].Value = dset.Tables[0].Rows[i]["RouteTitle"]; dgvHD["clmID", i].Value = dset.Tables[0].Rows[i]["ID"]; dgvHD["clmName", i].Value = dset.Tables[0].Rows[i]["Name"]; dgvHD["clmAddress", i].Value = dset.Tables[0].Rows[i]["Address"].ToString() + "\r\n " + dset.Tables[0].Rows[i]["City"].ToString() + ", " + dset.Tables[0].Rows[i]["ZipCode"].ToString(); dgvHD["clmApt", i].Value = dset.Tables[0].Rows[i]["AptNbr"]; dgvHD["clmPhone", i].Value = CCFBGlobal.FormatPhone(dset.Tables[0].Rows[i]["Phone"].ToString()); dgvHD["clmFamilySize", i].Value = dset.Tables[0].Rows[i]["FamilySize"]; dgvHD["clmComments", i].Value = dset.Tables[0].Rows[i]["Comments"]; dgvHD["clmDriverNotes", i].Value = dset.Tables[0].Rows[i]["DriverNotes"]; dgvHD["clmSvcItem", i].Value = dset.Tables[0].Rows[i]["HDItem"]; dgvHD["clmLastSvc", i].Value = CCFBGlobal.ValidDateString(dset.Tables[0].Rows[i]["LatestService"]); progressBar1.PerformStep(); } lblRowCnt.Text = "[ " + dgvHD.Rows.Count.ToString() + " ]"; rowIndex = 0; foreach (ToolStripButton tsb in toolStrip2.Items) { dgvHD.Columns[tsb.Tag.ToString()].Visible = tsb.Checked; } progressBar1.Value = 0; progressBar1.Visible = false; tbFindName.Visible = true; }