Am using telerik grid in MVC3 , my problem is how can i show limited text in a column that bound from database.
That means
i have a column with 1000 nvarchar data in database but i need to display only 250 in a column in a grid
Am using telerik grid in MVC3 , my problem is how can i show limited text in a column that bound from database.
That means
i have a column with 1000 nvarchar data in database but i need to display only 250 in a column in a grid
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Laalu ArPosted Apr 26, 2016, 8:00 AM
.Name("Grid")
.DataKeys(dataKeys => dataKeys.Add(o => o.Job_Id))
.DataBinding(dataBinding =>
dataBinding.Ajax()
.Select("_SelectAjaxEditing", "Home")
.Insert("_InsertAjaxEditing", "Home")
.Update("_SaveAjaxEditing", "Home")
.Delete("_DeleteAjaxEditing", "Home"))
.Columns(columns =>
{
columns.Bound(m => m.Position).Title("Position").Width(130);
columns.Bound(m => m.Required_Skills).Title("Required Skills").Width(250);
})
)
Rupali ShindePosted Apr 26, 2016, 4:32 AM
<telerik:GridBoundColumnDataField="Name"HeaderText="Name"UniqueName="Name">telerik:GridBoundColumn>protectedvoidRadGrid1_ItemDataBound(objectsender, GridItemEventArgs e){if(e.ItemisGridDataItem){GridDataItem item = e.ItemasGridDataItem;if(item["Name"].Text.Length > 200){item["Name"].Text = item["Name"].Text.Substring(0, 200);}}}