开发者

Details View in Asp.net, Set it to NEW

开发者 https://www.devze.com 2023-01-31 17:03 出处:网络
I have a grid view on my page, and a hidden details view. When the user wants to add a new entry, they will click a button, and the gridview will become hidden and the details view will become visible

I have a grid view on my page, and a hidden details view. When the user wants to add a new entry, they will click a button, and the gridview will become hidden and the details view will become visible. The only problem is I want my details view to automatically be set empty in the NEW mode, without them having to click the new in the details view form.开发者_如何学Go


In the RowCommand event of the gridview:

myDetailsView.Visible = true;
myDetailsView.CurrentMode = DetailsViewMode.Insert;
myGridView.Visible = false;


On button click change the mode like:

DetailsView1.ChangeMode(DetailsViewMode.Insert)
0

精彩评论

暂无评论...
验证码 换一张
取 消