Hi
I have a RadGrid in which is some data. One of the columns of data is an nvarchar(MAX) filed in which there could be a little to a lot of text, at the prerogative of the user.
I'm trying find a way to read the text out of the grid, modify it to be truncated down to say the first 50 characters, and put it back in the cell.
I found this page on this site that talks about this exact issue. Alas the code here does work.
http://www.telerik.com/help/aspnet/grid/grdaccessingcellsandrows.html
The code on this page says I can read the cell value with this syntax
TableCell cell = dataItem["ColumnUniqueName"];
Alas this does not work as 'dataItem' does not exist.
I have tried this code in my grids ItemDataBound method,
protected void rgNotes_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem && e.Item.OwnerTableView.DataSourceID == "dsNotes")
{
TableCell cell = dataItem["NoteText"];
}
}
I even tried
TableCell cell = e.Item["NoteText"];
to no avail.
Anyone here have a solution to this, what should be a pretty obvious' issue?
Brad