Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3475
TemplateDataField with asp:Button - need to process Button click on server
posted

Infragistics4.Web.v11.1, Version=11.1.20111.1006

Microsoft .NET Framework Verions 4.0.30319 SP1Rel

I have a WebHierarchicalDataGrid with a TemplateDataField that contains a asp:Button in the child Band.  When the user clicks on the Button, I need to catch the Button Click event on the server and know the row's data that the button is located in.  I am currently doing it a crazy way that is not giving me the row data and I am sure there is a better way of doing this. I have created a second hidden button outside of the grid.  In Javascript, catch the Grid_Click event, check if the column selected is the one that contains my button, then fire the second hidden button.  On the server side, I can get this button but on the row where the orginal button is located.  Can you help me please?

 

 

<ig:TemplateDataField Key="DocuSignSigner" Width="60px"><ItemTemplate><asp:Button ID= "btnDocuSignSigner" runat="server" Text ="Sign" SkinID="ResizedButton" Width ="60px"/></ItemTemplate><Header Text="" /></ig:TemplateDataField>

 

<

 

 

asp:Button ID="btnDocuSignSignerServer" runat="server" Style="visibility:hidden; "/>

 

 

 

 

 

 

BLOCKED SCRIPT

case 'DocuSignSigner':

 

 

 

var btnDocuSignSignerServer = $get('<%=btnDocuSignSignerServer.ClientID%>');

btnDocuSignSignerServer.click();

Parents
  • 49378
    posted

    Hi IntegraSys76,

    Thank you for posting in the community.

    You should be able to get access the grid row of the respective clicked row in the templated buttons Click handler using the sender parameter. For instance:

            Button button = (Button)sender;
            TemplateContainer templateContainer = ((Infragistics.Web.UI.TemplateContainer)(((Button)(sender)).Parent));
            GridRecordItem item = (GridRecordItem) (templateContainer.Item);
            GridRecord row = item.Row;

    Please let me know if this helps.

Reply Children