private void btnGo_Click(object sender, EventArgs e) { if (lkAccount.EditValue != null && fromDate.EditValue != null && toDate.EditValue != null) { var itm = new Item(); var distributeditems = itm.GetItemsDistributedByAccount(Convert.ToInt32(lkAccount.EditValue),Convert.ToDateTime(fromDate.EditValue),Convert.ToDateTime(toDate.EditValue)); gridControl1.DataSource = distributeditems; } else { XtraMessageBox.Show("Please select all the filters before clicking the button!", "Error"); } }