private void BindInvoiceNo()
 {
     _invMstr.CompanyId     = Convert.ToInt16(Session["CompanyId"]);
     _invMstr.PaymentStatus = Data.Constants.UnPaid;
     _dt = _sobj.SelectInvoiceStatus(_invMstr);
     foreach (DataRow row in _dt.Rows)
     {
         ddlInvoiceNo.DataSource     = _dt;
         ddlInvoiceNo.DataTextField  = "InvoiceNo";
         ddlInvoiceNo.DataValueField = "InvoiceId";
     }
     ddlInvoiceNo.DataBind();
     ddlInvoiceNo.Items.Insert(0, new ListItem("----------Select----------"));
     ViewState["Invoice_dt"] = _dt;
 }
 protected void ddlPayment_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlPayment.SelectedItem.Text == "All")
     {
         BindGridView();
         txtEndDate.Enabled   = false;
         txtStartDate.Enabled = false;
         btnFilter.Enabled    = false;
         txtStartDate.Text    = "";
         txtEndDate.Text      = "";
     }
     else
     {
         _invMstr.CompanyId     = Convert.ToInt16(Session["CompanyId"]);
         _invMstr.PaymentStatus = Convert.ToInt16(ddlPayment.SelectedItem.Value);
         _ds.Tables.Add(_sobj.SelectInvoiceStatus(_invMstr));
         gvInvoice.DataSource = _ds;
         gvInvoice.DataBind();
         txtEndDate.Enabled   = true;
         txtStartDate.Enabled = true;
         btnFilter.Enabled    = true;
     }
 }