private void backgroundWorkerSearch_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { toolStripButton1.Enabled = true; mailInfos = (CEnum.Message_Body[, ])e.Result; if (mailInfos[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mailInfos[0, 0].oContent.ToString()); return; } iPageCount = int.Parse(mailInfos[0, 13].oContent.ToString()); dataGV.DataSource = null; dataGV.DataSource = BrowseResultInfo(); isRedirect = false; Strategy.HideField hideField = new Strategy.HideField(); hideField.HideSomeFiled(dataGV); //DataTable dt = (DataTable)dataGV.DataSource; //for (int i = 0; i < dt.Rows.Count; i++) //{ // if (dt.Rows[i].ItemArray[10].ToString() == "1") // { // this.dataGV.Rows[i].DefaultCellStyle.BackColor = Color.Red; // } //} if (iPageCount <= 0) { cbxPageIndex.Visible = false; } else { for (int i = 0; i < iPageCount; i++) { cbxPageIndex.Items.Add(i + 1); } cbxPageIndex.SelectedIndex = 0; isRedirect = true; } }
private void backgroundWorkerPageChanged_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { this.cbxPageIndex.Enabled = true; this.Cursor = Cursors.Default; mailInfos = (CEnum.Message_Body[, ])e.Result; if (mailInfos[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mailInfos[0, 0].oContent.ToString()); return; } iPageCount = int.Parse(mailInfos[0, 10].oContent.ToString()); dataGV.DataSource = BrowseResultInfo(); Strategy.HideField hideField = new Strategy.HideField(); hideField.HideSomeFiled(dataGV); } catch { } }