cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

How to modify grid column title at runtime?

cdu
1-Newbie
1-Newbie

How to modify grid column title at runtime?

I can modify column title at design time, but how to modify it at run time?

4 REPLIES 4

You can't at runtime, but you can do a trick with a localization name, you can set the title to a localization name, and change title through changing localization token content.

Best Regards,

Carles.

yevans
4-Participant
(To:CarlesColl)

Hey Carles can you give an example on how you did this? I created a new token with the name of the infotable field name, but when I went to change the grid config, I tried "toggling" the column title to localization and left the text box next to it empty, but it reverts back after saving. Do I need to put something in there? If so, what? It will be different based on the info table being bound (I am dynamically changing the data shape at runtime).

Thanks!

ankigupta
5-Regular Member
(To:yevans)

Hi Yale Evans​,

As Infotable DataShape is changing at runtime; you might be using the Show All column property of the Grid widget.

So, as an alternative; you can use Rename Field to rename the Infotable field name and then show it in the grid.

var params = {

    t: "InfoTableName" /* INFOTABLE */,

    from: "OldFieldName" /* STRING */,

    to: "NewFieldName" /* STRING */

};

// result: INFOTABLE

var result = Resources["InfoTableFunctions"].RenameField(params);

I hope it helps.

yevans
4-Participant
(To:ankigupta)

Yes, thanks so much!

Top Tags