C# DevExpress查找编辑设置选定值

C# DevExpress查找编辑设置选定值,c#,devexpress,devexpress-windows-ui,C#,Devexpress,Devexpress Windows Ui,我有下面的网格,它在Win Form Load事件中填充InquiryDetails 通过双击一行,它将搜索所有详细信息并显示在“获取查询”选项卡中,如下所示,其代码位于图像下方 private void selectInquiry(object sender, EventArgs e) { btnAddInquiry.Enabled = false; btnUpdate.Enabled = true;

我有下面的网格,它在Win Form Load事件中填充InquiryDetails

通过双击一行,它将搜索所有详细信息并显示在“获取查询”选项卡中,如下所示,其代码位于图像下方

private void selectInquiry(object sender, EventArgs e)
        {


            btnAddInquiry.Enabled = false;
            btnUpdate.Enabled = true;
            txtInquiryNo.Enabled = false;


            String inquiryno = gridView1.GetFocusedDataRow()["InquiryNumber"].ToString();

            InquiryService inquiry = new InquiryService();
            inquiry = inquiry.searchInquiry(inquiryno);
            if (inquiry != null)
            {

                txtInquiryNo.Text = inquiry.InquiryNumber.ToString();
                //txtDate.Text = inquiry.InquiryDate;
                txtDate.Text = InfoPCMS.conversion.convertDate(inquiry.InquiryDate);

                txtCustomer.EditValue = inquiry.CustomerID.ToString();
                txtInquiryTaken.Text = inquiry.InquiryTaken;
                txtInspectionDetails.Text = inquiry.InspectionDetails;
                txtProblemNature.Text = inquiry.ProblemNature;
                txtProblemSource.Text = inquiry.ProblemSource;
                txtSiteResponsible.Text = inquiry.SiteResponsible;
                txtQuotationNo.Text = inquiry.QuotationNumber.ToString();
                txtFollowupDetails.Text = inquiry.FollowupDetails;
                txtInspectionDone.Text = inquiry.InspectionDone;

                tabInquiryManagement.SelectedTabPage = xtraTabPage2;

            }
            else
            {

                MessageBox.Show(InfoPCMS.message.GET_NO_SUCH_RECORD_INFORMATION(), "Information");

            }
        }

第一次搜索时,它工作正常,但在清除所有字段和页面并尝试另一条记录后,它会将除Lookupedit值之外的所有记录都设置为空状态,如下所示

private void clearGetInquiry() {

            txtInquiryNo.Text = "";
            txtDate.Text = "";
            txtCustomer.EditValue = null;

            txtInquiryTaken.Text = "";
            txtInspectionDetails.Text = "";
            txtProblemNature.Text = "";
            txtProblemSource.Text = "";
            txtSiteResponsible.Text = "";
            txtQuotationNo.Text = "";
            txtFollowupDetails.Text = "";
            txtInspectionDone.Text = "";

            btnAddInquiry.Text = "Add Inquiry";

            InquiryService inquiry = new InquiryService();
            int nextid = inquiry.getNextId();
            txtInquiryNo.Text = nextid.ToString();

            tabInquiryManagement.SelectedTabPage = xtraTabPage1;

            btnAddInquiry.Enabled = true;
            btnUpdate.Enabled = false;
            txtInquiryNo.Enabled = true;

        }

我怎样才能解决这个问题?(即使您在进入“获取查询”选项卡并返回后进行搜索,也会发生这种情况

private void clearGetInquiry() {

            txtInquiryNo.Text = "";
            txtDate.Text = "";
            txtCustomer.EditValue = null;

            txtInquiryTaken.Text = "";
            txtInspectionDetails.Text = "";
            txtProblemNature.Text = "";
            txtProblemSource.Text = "";
            txtSiteResponsible.Text = "";
            txtQuotationNo.Text = "";
            txtFollowupDetails.Text = "";
            txtInspectionDone.Text = "";

            btnAddInquiry.Text = "Add Inquiry";

            InquiryService inquiry = new InquiryService();
            int nextid = inquiry.getNextId();
            txtInquiryNo.Text = nextid.ToString();

            tabInquiryManagement.SelectedTabPage = xtraTabPage1;

            btnAddInquiry.Enabled = true;
            btnUpdate.Enabled = false;
            txtInquiryNo.Enabled = true;

        }