c# - MVC @Html.Grid Column Height Adjustment -


i looking display small section of text otherwise large block act "context clues". able adjust width of column cannot figure out how adjust height, or amount of lines displayed. code below:

@html.grid(model).columns(columns => {    columns.add(model => model.name).titled("name").sanitized(false).encoded(false)           .rendervalueas(model =>                   @html.actionlink(model.name, "details", new { id = model.id }));    columns.add(model => model.description).titled("description").sanitized(false).encoded(false).setwidth(350);    columns.add().sanitized(false).encoded(false).setwidth(15)           .rendervalueas(model =>                  <a class=\"btn btn-mini\" href=\"/laborcategory/edit/" + model.id + "\"><i class=\"icon-pencil\"/></a>");    columns.add().sanitized(false).encoded(false).setwidth(15)           .rendervalueas(model =>                  <a class=\"btn btn-mini\" href=\"/laborcategory/delete/" + model.id + "\"><i class=\"icon-trash\"/></a>"); }).sortable(true).filterable().withpaging(20) 

the particular line in question second columns.add line "description". don't want text field clickable, display text , truncate after "x" # of lines, characters, or whatever else use make work

thanks in advance

solution:

i used inline css styling. have wrap tag in otherwise won't work..

.rendervalueas(model => "<div style='white-space:nowrap; width: 350px; height:50px; overflow:hidden; text-overflow:ellipsis;'>"+model.description+"</div>") 


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -