单击行编辑按钮时,我需要一个标签字段 [英] i want one label field when i click rowediting button
本文介绍了单击行编辑按钮时,我需要一个标签字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两列(Country_id,country_name)...如果单击行编辑按钮,则数据将显示在网格视图内的文本框中进行编辑...我只想编辑country_name,而我不想编辑country_id. .当我单击编辑按钮country_id必须显示在标签中..我想要该代码..
im having two columns(Country_id,country_name)...if click row editing button the data will display in the textbox inside the grid view for editing...i want to edit only country_name and i dont want to edit country_id..when i click the edit button country_id has to be displayed in label..i want the coding for that..
推荐答案
ok for that you should make country_id readonly....<br />
Go to properties of gridview, select columns and select first Coloumn(id) and make readonly true....<br />
or <br />
you can apply this property dynamically in load_event...<br />
嗨!
您必须在asp代码中将country_id字段设置为只读.并将可见值插入为false,以使用户无法对其进行编辑.
Hi!
You have to set in asp code that field country_id is read only. and insert visible value to false so that user can not edit it.
<asp:boundfield datafield="country_id" headertext="country_id" insertvisible="False" readonly="True" sortexpression="country_id" xmlns:asp="#unknown" />
谢谢.
Thanks.
这是解决方案..
如下定义CustomerID字段..
里面EditItemTemplate
Here is The Solution..
Define CustomerID Field as follows..
Inside EditItemTemplate
<columns>
<asp:TemplateField HeaderText="Country ID" >
<itemtemplate>
<%#Eval("Country_id")%>
</itemtemplate>
<edititemtemplate>
<asp:Textbox id="txtCountry_id" runat="server" Enabled="false">
Text=''<%#Eval("Country_id")%>''>
</edititemtemplate>
</columns>
以后如果您有疑问,请重播我...
Later If You Will Have Doubts Just Replay Me...
这篇关于单击行编辑按钮时,我需要一个标签字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文