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