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
190
Retrieve grid data in template data field
posted

I have a template data field in a WebDataGrid.  In the template is a button and when the user clicks on the button, I want to display the contents of a hidden column (I do not want to go back to the server for this data).  I have this code for my template field:

                            <ig:TemplateDataField Key="NotesButton">

                                <ItemTemplate>

                                 <input runat="server" type="button" value="Notes"  onclick="BLOCKED SCRIPTShowNotes()" /> 

 

                                <asp:Button runat="server" Text="asp but" OnClientClick="BLOCKED SCRIPTShowNotes()" />

                                </ItemTemplate>

                            </ig:TemplateDataField> 

  And the following for my Javascript.

 

                      function ShowNotes(webDataGrid, evntArgs) {

                          var grid = $find("<%= grdSchedule.ClientID %>");

                          var activeRow = grid.get_behaviors().get_activation().get_activeCell().get_row();

                          alert(activeRow.get_cell(0).get_value());

                          return false;

                      }

The event fires but i suspect that there is no active row since there is no row selected.  How do i get the data from a cell of the row that contains the templated data field without making the user select the row first?

 

Thanks