开发者

In ASP.NET, i have a DataGridView Control, how can i add a edd button and how to plud code to that without use GUI, only through Programmee

开发者 https://www.devze.com 2023-01-28 08:45 出处:网络
In ASP.NET,开发者_StackOverflow i have a DataGridView Control, how can i add a edd button and how to plud code to edit, without useing GUI, only through ProgramYou can use the commandfield class and c

In ASP.NET,开发者_StackOverflow i have a DataGridView Control, how can i add a edd button and how to plud code to edit, without useing GUI, only through Program


You can use the commandfield class and can manually add the edit colum from in the code as below:

 CommandField field = new CommandField();
 field.ButtonType = ButtonType.Button;
 field.ShowEditButton = true;
 GridView1.Columns.Add(field);

Then handle the edit row event of the gridview. you can set all sorts of properties in the commandfield object like you do from the gui.

0

精彩评论

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