Gridveiw编辑按钮单击必须只编辑3列 [英] Gridveiw edit button click must edit only 3 columns

查看:60
本文介绍了Gridveiw编辑按钮单击必须只编辑3列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds,



如何在gridview中使用多个编辑按钮,这样用户可以使用左编辑按钮编辑左列,使用右编辑按钮编辑右列在gridview。



请帮助



谢谢。

解决方案

在您不想编辑的所有内容上设置 ReadOnly =true属性。

参考: BoundField.ReadOnly Property [ ^ ]

< columns> 
< asp:boundfield datafield = LoginName headertext = 登录名 readonly = True xmlns:asp = #unknown />
< asp:boundfield datafield = FirstName headertext = 名字 readonly = True xmlns:asp = #unknown />
< asp:boundfield datafield = LastName headertext = 姓氏 readonly = True xmlns:asp = #unknown />
< asp:boundfield datafield = UserType headertext = 用户类型 readonly = True xmlns:asp = #unknown />
< asp:boundfield datafield = EmailAddress headertext = EmailAddress xmlns:asp = #unknown />
< / >





只需将 ReadOnly 选项设置为true即< b>不要希望人们编辑。在编辑模式下,用户没有此设置或 ReadOnly 设置为false的列为可编辑


Hi frnds,

How to work with multiple edit buttons in gridview, so user can edit left columns with left edit button, and right columns with right edit button in gridview.

Please help

thank you.

解决方案

Set the ReadOnly="true" property on all that you don't want editable.
Refer: BoundField.ReadOnly Property[^]

<columns>
    <asp:boundfield datafield="LoginName" headertext="Login Name" readonly="True" xmlns:asp="#unknown" />
    <asp:boundfield datafield="FirstName" headertext="First Name" readonly="True" xmlns:asp="#unknown" />
    <asp:boundfield datafield="LastName" headertext="Last Name" readonly="True" xmlns:asp="#unknown" />
    <asp:boundfield datafield="UserType" headertext="User Type" readonly="True" xmlns:asp="#unknown" />
    <asp:boundfield datafield="EmailAddress" headertext="EmailAddress" xmlns:asp="#unknown" />
</columns>



Just set the ReadOnly option to true on the columns you DON'T want people to edit. The columns that don't have this set or have ReadOnly set to false are editable by the user when in edit mode.


这篇关于Gridveiw编辑按钮单击必须只编辑3列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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