如何访问rep_DataSimilarToBacthid
?
我需要绑定GridView并调用GridView RowDataBound或InitializeRow
<asp:Repeater ID="rep_UnAssignComps" runat="server">
<ItemTemplate>
<asp:Repeater ID="rep_UnAssignComps" runat="server">
<ItemTemplate>
<asp:GridView ID="rep_DataSimilarToBacthid" runat="server" Style="text-align: center;
width: 375px;" AutoGenerateColumns="false">
<Columns>
<asp:BoundField HeaderText="Test" DataField="Test" />
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
我正在使用VB.Net和Framework Version 2.0。感谢
答案 0 :(得分:2)
在你的代码后面添加这样的功能:
Protected Sub grid_RowDataBound(sender As Object, e As GridViewRowEventArgs)
End Sub
对你的GridView控件添加OnRowDataBound =“grid_RowDataBound”,你得到:
<asp:GridView ID="rep_DataSimilarToBacthid" runat="server" OnRowDataBound="grid_RowDataBound" ...