Updating a control in a Grid Toolbar

2 posts, 0 answers
  1. Pier-Gilles
    Pier-Gilles avatar
    2 posts
    Member since:
    Aug 2016

    Posted 01 Nov 2016 Link to this post


    I'm trying to update a label inside a grid toolbar  with the Count on selectedItem of the grid.

    I'm able to retrieve the number of selected item with the "onChange" event ( in an JS alert in my test)


    <script type="text/javascript">
        function onChange(arg) {
            var selected = $.map(this.select(), function (item) {
                return $(item).text();

    but i'm having trouble accessing the label inside the toolbar of the grid (to modify the text property).

    I'm not quite sure of the syntax to retrieve the label..  

    I tried several way to access it and I'm having not luck so far.


    Is there a way to access a control inside the toolbar of a grid from JavaScript?


    Note:  I'm using "Telerik.UI.for.AspNet.Core": "2016.3.914"


  2. Konstantin Dikov
    Konstantin Dikov avatar
    2115 posts

    Posted 04 Nov 2016 Link to this post


    You can set an ID for the element that you are using in the toolbar and get reference to it with jQuery. For your convenience, following is an example with such approach:
        function onChange(e) {
            .ToolBar(t=>t.Template("Selected items: <span id='selectCount'>0</span>"))

    Best Regards,
    Konstantin Dikov
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top