如何通过编辑和更新动态创建网格视图 [英] how to create gird view dynamically with edit and update

查看:82
本文介绍了如何通过编辑和更新动态创建网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格,我想用动态列绑定(我可以增加或减少)。

我也编辑该记录。



请帮忙解决。

I have a grid and I want to bind with dynamically column (My be increase or decrease).
and I also edit that record.

please help to resolve .

推荐答案

引用:

怎么样在gridview中添加服务器端的编辑按钮

how to add edit button on server side in gridview

无需从Code Behind添加。您可以设置 GridView.AutoGenerateEditButton Property [ ^ ]为真。

No need to add from Code Behind. You can set GridView.AutoGenerateEditButton Property[^] to true.

引用:

AutoGenerateEditButton 属性设置为 true 时,列(由 CommandField <代表/ a> object),每个数据行的 Edit按钮自动添加到 GridView 控件。单击行的编辑按钮可将该行置于编辑模式。当行处于编辑模式时,行中不是只读的每个列字段都会显示相应的输入控件,例如 文本框 控制,用于字段的数据类型。这允许用户修改字段的值。

When the AutoGenerateEditButton property is set to true, a column (represented by a CommandField object) with an Edit button for each data row is automatically added to the GridView control. Clicking an Edit button for a row puts that row in edit mode. When a row is in edit mode, each column field in the row that is not read-only displays the appropriate input control, such as a TextBox control, for the field's data type. This allows the user to modify the field's value.

单击时,编辑按钮也会替换为更新按钮和取消按钮。单击更新按钮可更新数据源中的行,并更改任何值,并将该行返回到显示模式。单击取消按钮放弃任何值更改并将行返回到显示模式。

When clicked, the Edit button is also replaced with an Update button and a Cancel button. Clicking the Update button updates the row in the data source with any value changes and returns the row to display mode. Clicking the Cancel button abandons any value changes and returns the row to display mode.


这篇关于如何通过编辑和更新动态创建网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆