Why is that?
Because if you do not explicitly specify the columns, the helper uses reflection to inspect the public properties of the type and autogenerates a column for them. So the System.String
has the .Length
public property and thus you get a column for it.
You will need to use a custom column:
@grid.GetHtml(
columns: grid.Columns(
grid.Column("email", format: item => item)
)
)
Alternatively you could define a view model and have your IEnumerable<T>
use this view model instead of string.