private void DoQuery() { if (m_RCard != null) { this.m_RCard.Rows.Clear(); this.m_RCard.AcceptChanges(); } if (moFacade == null) { moFacade = new MOFacade(this.DataProvider); } string[] rCardList = moFacade.GetRcardsByMoAndItem(this.TxtMoCode.Value.Trim(), this.ItemCode); if (rCardList == null || rCardList.Length <= 0) { return; } if (rCardList != null) { DataRow rowNew; foreach (string rCard in rCardList) { rowNew = this.m_RCard.NewRow(); rowNew["Checked"] = false; rowNew["RCard"] = rCard; this.m_RCard.Rows.Add(rowNew); } this.m_RCard.AcceptChanges(); } this.ultraGridRCard.DataSource = m_RCard; this.ultraGridRCard.UpdateData(); if (this.checkBoxSelectedAll.Checked) { for (int i = 0; i < ultraGridRCard.Rows.Count; i++) { this.ultraGridRCard.Rows[i].Cells[0].Value = this.checkBoxSelectedAll.Checked; } this.ultraGridRCard.UpdateData(); } this.ultraGridRCard.ActiveRow = null; }