私は次のようにASP.NET GridViewを持っています...
<asp:GridView ID="grdUserDecisions" runat="server" CssClass="Grid"
OnPageIndexChanging="grdUserDecisions_PageIndexChanging"
OnSorting="grdUserDecisions_Sorting">
<HeaderStyle CssClass="GridHeader"/>
<AlternatingRowStyle CssClass="GridAltItem"/>
<RowStyle CssClass="GridItem"/>
<PagerStyle CssClass="GridPager"/>
<Columns>
<%-- I don't want a link --%>
<asp:HyperLinkField
DataNavigateUrlFields="Name"
DataNavigateUrlFormatString="/default.aspx?id={0}"
DataTextField="Name" HeaderText="Name" />
<%-- I want the id value to be set in the DOM --%>
<asp:ButtonField ID='<%# Eval("Name") %>' DataField="Name" />
</Columns>
</asp:GridView>
動的に入力される DOM に ID 値を持つ Bound 列を追加することは可能ですか?
ID プロパティがないため、この行は機能しません。使用する別の列タイプはありますか?
<asp:ButtonField ID='<%# Eval("Name") %>' DataField="Name" />
前もって感謝します。