Search code examples
c#asp.netasp.net-mvcwebgrid

How to add format to an existing column (WebGrid.Column)


I have an existing column declaration

grid.Column("ID", "", format: @<text><input id=... tons of html here .. >)

And I want to use it in my code. However, I don't really understand what this format" parameter is, and how to add it to an existing column? As In, I want to use column.format = I don't know what. I know that format is an argument of type Func<dynamic, object> , what means it's a function that takes a dynamic and returns object. But WebGridColumn doesn't have a function "format". Where can I find it?


Solution

  • To any person that might be wondering about this in the future: You can just type

    idColumn.Format = @<text> </text>