Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Trigger Control Inside GridView ItemTemplate

$
0
0

Hi all

I have an UpdatePanel: uplVirtual_Work that contains a GridView: gvwVirtual_Work. The GridView has a TemplateField that contains an Image ButtonigbDelete_VW.

The function of the igbDelete_VW is delete a row from the the grid view gvwVirtual_Work.

<asp:UpdatePanel ID="uplVirualWork" runat="server"><ContentTemplate><asp:GridView runat="server" ID="gvwVirtual_Work" AutoGenerateColumns="False" ShowHeader="False"><Columns><asp:BoundField DataField="Sno" HeaderText="م" ItemStyle-Width="3%" ></asp:BoundField>
             .........
             .........
             .........<asp:TemplateField ItemStyle-Width="4%" ItemStyle-HorizontalAlign="Center"><ItemTemplate><asp:ImageButton ID="igbDelete_VW" runat="server" ImageUrl="~/images/Del_Circle.png"
                  CommandName="igbDelete_V" CommandArgument="<%# CType(Container, GridViewRow).RowIndex%>"  /></ItemTemplate></asp:TemplateField></Columns></asp:GridView></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="igbDelete_VW" EventName="Click" /></Triggers></asp:UpdatePanel>



Protected Sub gvwVirtual_Work_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvwVirtual_Work.RowCommand
        Dim index As Integer = Convert.ToInt32(e.CommandArgument)
        gvwVirtual_Work.DeleteRow(index)
End Sub

When I run the code I get the following Error:

Server Error in '/' Application.


A control with ID 'igbDelete_VW' could not be found for the trigger in UpdatePanel 'uplVirualWork'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>