Well you can use some UI tricks there but it depends on how you display your
dataset. For example, if your dataset has a table with a large field bound
to a GridView then you can use GridView's RowDataBound event and put some
code that visually trims your data. Here is a sample considering a GridView
which has some simple bound fields (place it in RowDataBound event handler
method of a GridView):
//Assuming your GridView displays two fields Title and FirstName
// in that order.
if(e.Row.RowType == DataControlRowType.DataRow)
{
//e is the GridRowEventArgs and Cells[1] is the FirstName field of a
//particular row. And assume any FirstName has minimum length of
//2 characters
e.Row.Cells[1].Text = e.Row.Cells[1].Text.Substring(0, 2);
// So you trimmed down your FirstName field to 2 characters.
}
It's not the best way but solution depends on the scenario you are working
on.
"Stephen" <st********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi,
Suppose there is a column in the dataset that is a very large field (say
varchar(500)) and i want to display partial information with (....) so
that
the user can click on it to view for more.
(I dont want to truncate any info in the dataset...)
How can display partial information in a datagrid?
Thanks,
Stephen