I have a gridview, that shows record according to the selected value in the dropdownlist. This works, on pageload the gridview only contains the records that it should contain. But after choosing a different option in the dropdownlist, the gridview does not change. I've tried fixing it with this:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
GridView1.DataBind();
}
But that does not work. I believe it's a very small matter, but after googling it I can't figure out what to do.
It's hard to tell what you're currently doing from the code you've posted but typically you'd need to -
The code you've posted looks as if it's only doing a bind of the already existing data to the GridView
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.