This is a migrated thread and some comments may be shown as answers.

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

3 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 23 Jun 2015, 08:59 PM

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.

3 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 23 Jun 2015, 10:09 PM

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.

0
Konstantin Dikov
Telerik team
answered on 26 Jun 2015, 10:07 AM
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
0
Mike
Top achievements
Rank 1
answered on 26 Jun 2015, 03:39 PM
Thanks Konstantin; good advice and I'll make the change.
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or