How to change the format of a Grid Boolean column - Forum - Kendo UI Builder - Progress Community

How to change the format of a Grid Boolean column

 Forum

How to change the format of a Grid Boolean column

This question is answered

Hi!

I'm trying to change the format of a Boolean column showed in a grid. I want to show the format "Si/No" for "True/False" so it show similar to the filter labels. I've tried with the field template but I haven't been able.

Any idea?

Verified Answer
  • Hi Carlos,
     
    I tried this by adding a template for the grid columns and was able to achieve the same. Please find below details:
     
    I have a grid and by default following is how a boolean field is represented in the grid columns.
     
     
    Now add a template for the grid column in the KUIB environment as below:
    • Navigate to KUIB designer
    • In the view, in the properties section click on Edit button next to ‘Grid Columns’
    • Select specific field under ‘Included Columns’ section and
    • Click on Edit button next to Template option
    • Add following code snippet
                                    # if (<field_Name> == true) { # Si #} else { # No # } #
    • Save the app and click on Generate/Preview and observe that the generated web app is shown as below
     
     
     
    Hope this helps.
     
    Thanks and Regards,
    Anil Kumar
     
All Replies
  • Hi Carlos,
     
    I tried this by adding a template for the grid columns and was able to achieve the same. Please find below details:
     
    I have a grid and by default following is how a boolean field is represented in the grid columns.
     
     
    Now add a template for the grid column in the KUIB environment as below:
    • Navigate to KUIB designer
    • In the view, in the properties section click on Edit button next to ‘Grid Columns’
    • Select specific field under ‘Included Columns’ section and
    • Click on Edit button next to Template option
    • Add following code snippet
                                    # if (<field_Name> == true) { # Si #} else { # No # } #
    • Save the app and click on Generate/Preview and observe that the generated web app is shown as below
     
     
     
    Hope this helps.
     
    Thanks and Regards,
    Anil Kumar
     
  • Hi Anil,

    Thank you very much for your help!! It's worked perfectly!

    Kind Regards

    Carlos Calpe