locked
adding style to Html.Raw in a webgrid RRS feed

  • Question

  • User379720387 posted

    I need the Yes in green and the No in red.

    grid.Column("isNew", header: "Not Linked", style: "col1", format: (item) => item.isNew == 1 ? Html.Raw("Yes") : Html.Raw("No"))

    Monday, January 9, 2017 1:45 AM

Answers

  • User-821857111 posted
    grid.Column(
        "isNew", 
    	header: "Not Linked", 
    	style: "col1", 
    	format: (item) => item.isNew == 1 ? Html.Raw("<span color="green">Yes</span>") : Html.Raw("<span color="red">No</span>")
    )
    

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 9, 2017 7:41 AM