/// <summary> /// Function to fill Datagridview /// </summary> public void gridfill() { try { PaymentVoucherBll BllPaymentVoucher = new PaymentVoucherBll(); PaymentMasterInfo infoPaymentMaster = new PaymentMasterInfo(); List<DataTable> listObj = new List<DataTable>(); if (cmbAccountLedger.Items.Count > 0) { if (cmbAccountLedger.SelectedValue.ToString() != "System.Data.DataRowView") { if (txtFromDate.Text.Trim() != string.Empty && txtToDate.Text.Trim() != string.Empty) { listObj = BllPaymentVoucher.PaymentMasterSearch(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), Convert.ToDecimal(cmbAccountLedger.SelectedValue), txtVoucherNo.Text); dgvPaymentRegister.DataSource = listObj[0]; } } } } catch (Exception ex) { MessageBox.Show("PREG4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }