如何在gridview中将自定义属性添加到asp Boundfiled类? [英] How I can Add Custom Property to asp Boundfiled Class in gridview?
本文介绍了如何在gridview中将自定义属性添加到asp Boundfiled类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我需要帮助将自定义属性添加到gridview中的asp绑定字段。任何人都可以帮我解决这个问题。为了更加清晰,请参阅下面的代码。
< asp:GridView ID =GridView2runat =server>
< ;列> < asp:BoundField DataField =idHeaderText =Ids mycustomproperty =true />
我想将mycustompropety添加到asp:数据绑定控制器。
可以任何一个帮助吗?
Hello,
I need a help to add custom property to asp bound field in gridview. can anyone help me to resolve this issue. for more clarity see the below code.
<asp:GridView ID="GridView2" runat="server">
<columns> <asp:BoundField DataField="id" HeaderText="Ids" mycustomproperty="true" />
I want to add mycustompropety to asp:databound contrl.
can any one help?
推荐答案
我建议你转到TemplateField
并在里面添加你要绑定的控件。
否则,你可以查看以下文章。
1. GridView中必需的BoundField [ ^ ]
2. 如何在GridView中创建自定义绑定字段 [ ^ ]
I would suggest you to go forTemplateField
and inside that add whatever control you want to bind.
Otherwise, you can look at the below articles.
1. Required BoundField in GridView[^]
2. How to create custom bound fields in GridView[^]
这篇关于如何在gridview中将自定义属性添加到asp Boundfiled类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文