2
Answers

How to include custom values in dropdown

Photo of AL MUBARAK

AL MUBARAK

14y
7.5k
1

Hi,
  Now i need my project for adding cusomt values in dropdown. meantime. I had dropdown named biodata, its consists of age, gender,sex, religion. Now i need add item name custom for users chooses its from dropdown another pop-up will appear, and it had form and they filled it up thier details respectively.
Anyone could known pls help me.
Advance in Thanks
H.AL-MUBARAK
 
 
  

Answers (2)

0
Photo of Hermes Condez
NA 32 0 13y

try this one, though I didn't test this on printing the exported XLS

protected void ExportToXls_Click(object sender, EventArgs e) //On click Event of a control (button/link button/hyperlink)
 {

        this.DataGridView1.AllowPaging = false;

        ExportGridViewToExcel(Response, this.DataGridView1, "Exported.xls");
 }

 public void ExportGridViewToExcel(HttpResponse response, GridView gvControl, string fileName)
        {
            string attachment = "";
            System.IO.StringWriter sw = new System.IO.StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            response.AddHeader("content-disposition", "attachment; filename=" + fileName);
            response.ClearContent();
            response.AddHeader("content-disposition", attachment);
            gvControl.AllowPaging = false;
            gvControl.DataBind();
            gvControl.RenderControl(htw);
            response.Write(sw.ToString());
            response.Flush();
            response.End();

            gvControl.AllowPaging = true;
        }

 public override void VerifyRenderingInServerForm(Control control) // I just got this in forum just
           // add this. I don't why but it will work if this is added
        {
        }