I really hope someone can help me with this because it's really driving me crazy. I need to dynamically display multiple data tables on a page so I am using a Repeater to do so and in the ItemTemplate of the Repeater I am adding a Gridview control. One of the columns of the GridView control is a TemplateColumn that contains an ImageButton.
The tricky thing is that I am using .NET 2.0 and it seems that I have to register this control (I'm not sure if it's the gridview I have to register or the actual imagebutton within the gridview) for event validation.
I've tried overriding the Render method on the page and registering the control as follows:
Page.ClientScri pt.RegisterForE ventValidation( CType(item.Cont rols(1), GridView).Uniqu eID)
.. with no luck.
Can someone please help me, this is driving me crazy. I'm at my wits end.
Here is my Repeater mark up:
<asp:Repeater ID="rptMain" runat="server" >
<HeaderTemplate >
<table width="90%">
<tr>
<th align="center"> Bid #</th>
<th align="center"> Bid Name</th>
<th align="center"> Sequence #</th>
<th align="center"> Sequence Desc</th>
<th align="center"> Bid Qty</th>
<th align="center"> Bid UOM</th>
</tr>
</HeaderTemplate>
<ItemTemplate >
<tr>
<td class="bidInfoC ell"><%#Eval("L iBidNum")%></td>
<td class="bidInfoC ell"><%#Eval("L iBidDesc")%></td>
<td class="bidInfoC ell"><%#Eval("L iSeqNum")%></td>
<td class="bidInfoC ell"><%#Eval("L iSeqDesc")%></td>
<td class="bidInfoC ell"><%#Eval("L iBidQty")%></td>
<td style="font-size:smaller;"> <%#Eval("LiBidU OM")%></td>
</tr>
<tr>
<td colspan="6">
<asp:gridview ID="gvwPastSear ch" runat="server" AutoGenerateCol umns="false"
CssClass="table grid" Width="100%" OnRowCommand="g vwPastSearch_Ro wCommand" >
<RowStyle CssClass="Table ItemRow" VerticalAlign=" Top" Font-Size="small"></rowStyle>
<Alternatingrow Style CssClass="Table AlternateRow" Font-Size="small"></AlternatingrowS tyle>
<HeaderStyle CssClass="Table Header" ForeColor="Whit e" font-size="small"></HeaderStyle>
<PagerStyle BackColor="Ligh tSlateGray" ForeColor="Whit e" />
<Columns>
<asp:Boundfie ld DataField="LiBi dCost" HeaderText="Cos t"></asp:Boundfield>
<asp:Boundfie ld DataField="LiBi dSell" HeaderText="Sel l"></asp:Boundfield>
<asp:Boundfie ld DataField="LiIt emBid" HeaderText="Bid ?"></asp:Boundfield>
<asp:Templatefi eld HeaderText="Add/Remove/Move">
<ItemTemplate >
<asp:ImageButto n ID="imgbtnPastR owCommand" runat="server"
ImageUrl="Image s/arrow.gif" CommandName="Ad dItem" />
</ItemTemplate>
</asp:Templatefie ld>
</Columns>
</asp:gridview>
</td>
</tr>
</ItemTemplate>
<SeparatorTempl ate>
<tr>
<td colspan="6">
<hr />
</td>
</tr>
</SeparatorTempla te>
<FooterTemplate >
</table>
</FooterTemplate>
</asp:Repeater>