This is a migrated thread and some comments may be shown as answers.

[Solved] Trim string in bound column

0 Answers 3 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tas
Top achievements
Rank 1
Tas asked on 01 Apr 2013, 07:46 PM
I have a column named Description which can have either an empty string or a long description.
I want to trim the string if it is longer than 10 words or specific number of characters.
I tried doing this but  nothing works.  Please help me.. Thank you.

columns.Bound(o => o.Description)

.Template(o =>

{

if (o.Description.Length >= 100)

{ o.Description.Trim(); }

});


and also,

.CellAction(cell =>

{

if (cell.Column.Title == "Description")

{

cell.Text = cell.Text.Remove(100) +

 

".....";

 }

 

 

 

})

Tags
Grid
Asked by
Tas
Top achievements
Rank 1
Share this question
or