Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Grid > Accessing label object inside NoRecordsTemplate

Not answered Accessing label object inside NoRecordsTemplate

Feed from this thread
  • dexter avatar

    Posted on Feb 9, 2012 (permalink)

    Hi,

    I'm trying to get the reference of the label object inside NoRecordsTemplate using client side.
    Is it possible? How?


    Thanks.
    Dexter

    Reply

  • Tsvetoslav Tsvetoslav admin's avatar

    Posted on Feb 9, 2012 (permalink)

    Hi dexter,
    $telerik.$("tr.rgNoRecords >td>div")[0].innerHTML

    Hope it helps.

    Greetings, Tsvetoslav
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • dexter avatar

    Posted on Feb 9, 2012 (permalink)

    Hi,

    Thank you very much for your reply. Unfortunately, it didn't work. It returns undefined.
    The label i'm trying to access is as below:
    <NoRecordsTemplate
      <table>
        <tr>
          <td align="center" valign="middle">
            <asp:Label runat="server" ID="lblNoRecords" CssClass="label"></asp:Label>
          </td>
        </tr>
      </table>
    </NoRecordsTemplate>

    On another matter, the code you sent me :

    $telerik.$(

     

    "tr.rgNoRecords >td>div")[0];
    What kind of accessing method is this? Is this somewhat like XSLT?
    Where is the documentation for this access method?

    Regards,
    Dexter

     

    Reply

  • Tsvetoslav Tsvetoslav admin's avatar

    Posted on Feb 10, 2012 (permalink)

    Hello Dexter,

    I was not aware that you are using a custom template. Here is a possible solution:
    $telerik.$("tr.rgNoRecords >td").find(".label")[0].innerHTML

    Do note that ".label" refers to the css class and not to the type of the server control which besides that is rendered on the client as a <span> element in your case.

    And this jQuery - the $telerik.$ exposes its API. More information you can find below:
    http://docs.jQuery.com

    Hope it helps.
     
    Regards,
    Tsvetoslav
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • dexter avatar

    Posted on Feb 13, 2012 (permalink)

    Hi Tsvetoslav,

    Thanks for your help. Its working now. However, the jquery link you sent me doesn't
    seem to explain how to use the symbols like '>'.  Do you mind giving me another link?

    Thanks again.
    Dexter

    Reply

  • Tsvetoslav Tsvetoslav admin's avatar

    Posted on Feb 14, 2012 (permalink)

    Hello Dexter,

    Certainly I don't: http://api.jquery.com/category/selectors/ 

    In particular, do take a look at the parent-child selector.

     

    Greetings,
    Tsvetoslav
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Grid > Accessing label object inside NoRecordsTemplate
Related resources for "Accessing label object inside NoRecordsTemplate"

ASP.NET Grid Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]