How can I dynamically change the HeaderText of a GridColumnGroup on the client

4 posts, 0 answers
  1. Mike
    Mike avatar
    10 posts
    Member since:
    Jan 2014

    Posted 23 Jun 2015 Link to this post

    Based upon a user's selection of a dropdownlist item (which is on the page, but is not part of the grid), I need to alter the text of a GridColumnGroup in a batch mode grid.  Essentially, the user's selection is used to determine what fields are used in a calculation.  I need to alter the GridColumnGroup text so that it reflects their choice.  I would prefer to do this using client-side code.    At this point, have what I need to dynamically perform the calculations, but I haven't found an example showing how to update the GridColumnGroup text value.

    Thanks.

  2. Mike
    Mike avatar
    10 posts
    Member since:
    Jan 2014

    Posted 23 Jun 2015 Link to this post

    Unless, or until, I hear of a better solution, I decided to do the following:

    masterTableView.getColumnByUniqueName("UniqueNameHere")._element.parentCell.innerText = "NewHeaderTextHere";

     Essentially, I have to get the parentCell (i.e. GridColumnGroup) and update it's text.

  3. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 26 Jun 2015 Link to this post

    Hello Mike,

    With the current implementation of the client-side object of the grid, the solution that you have found is the only valid option for this requirement. The only recommendation that I could give is that you avoid using private methods and use the corresponding public methods of the objects (instead of _element you should use get_element() method).


    Best Regards,
    Konstantin Dikov
    Telerik
    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
  4. Mike
    Mike avatar
    10 posts
    Member since:
    Jan 2014

    Posted 26 Jun 2015 in reply to Konstantin Dikov Link to this post

    Thanks Konstantin; good advice and I'll make the change.
Back to Top