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
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.
精彩评论