1

I am creating a web page that contains one Dropdownlist and Gridview.

Query is Dropdownlist will contains SQL Server database table list. When I select a table name from dropdownlist the Gridview needs to show entire table data and able to perform edit, update, delete, cancel actions.

When I click edit, Gridview need to show Update and Cancel buttons and it update should update dropdownlist table and also delete.

Please any one can help.

Thanks in advance.

4

2 回答 2

1

您必须重新绑定您的网格视图,更改下拉列表的选定索引,如下所示

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
    gridview.DataSource = dataSource;
    gridview.DataBind();
}

其中 datasource 是您的数据库查询结果

于 2013-03-03T13:29:36.930 回答
0

您必须挂钩更改 dropdoenlist,然后更新您的网格

protected void YourDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
    YouGridview.DataSource = YourdataSource;
    YouGridview.DataBind();
}
于 2013-03-03T13:36:01.327 回答