且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在运行时添加行的Gridview中,下拉列表未绑定.

更新时间:2023-12-06 15:23:10



如果拥有运行时数据,则需要在页面初始化时绑定数据.

因为一旦页面回发,所有在运行时生成的数据都将丢失.因此,对于每次回发,都应再次绑定运行时数据.

因此,在您的情况下,您需要在PageInitialization处调用SetInitialRow.

谢谢
-Amit.
Hi,

When you have runtime data, you need to bind your data at the time of Page Initialization.

Because once page is postback all the data that generated at runtime will be lost. So for each postback your runtime data should be bound again.

So in your case you need to call your SetInitialRow at PageInitialization.

thanks
-Amit.


Haii Friends ..我必须使用

Haii Friends.. I have to use

DropDownList dl = (DropDownList)e.Row.FindControl("ddlField");
dl.DataSource = DT;
.
.
.
.

DropDownList dl = (DropDownList)dgrGenQry.Rows[e.Row.RowIndex].Cells[0].FindControl("ddlField");
dl.DataSource = DT;



谢谢........



Thank you........