/// <summary> /// Function to use the Tax gridfill /// </summary> public void TaxGridFill() { string strTaxName = string.Empty; try { List<DataTable> ListObj = new List<DataTable>(); TaxBll bllTax = new TaxBll(); string strTaxApplicableOn = "Product"; ListObj = bllTax.TaxViewAllByVoucherTypeId1(decSalesReturnVoucherTypeId, strTaxApplicableOn); dgvCmbTax.DataSource = ListObj[0]; foreach (DataRow item in ListObj[0].Rows) { strTaxName = item["taxName"].ToString(); if (strTaxName != "NA") { DataRow dr = ListObj[0].NewRow(); dr["taxName"] = "NA"; dr["taxId"] = 1; ListObj[0].Rows.InsertAt(dr, 0); } break; } dgvCmbTax.ValueMember = "taxId"; dgvCmbTax.DisplayMember = "taxName"; } catch (Exception ex) { MessageBox.Show("SR64:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }