try this code on your rowbound event
protectedvoid GridView1_RowDataBound(object sender,GridViewRowEventArgs e){
if (e.Row.RowIndex != -1){
e.Row.Cells[4].ToolTip = e.Row.Cells[4].Text;
e.Row.Cells[4].Text = e.Row.Cells[4].Text.Substring(0, 15);
}
}
i wrap the text of column 4 th to only 15 character and showing the tooltip as a whole text which was the actual value of that column
You can integrate something like this into your grid:http://www.cssplay.co.uk/menu/more.html
-Damien
That's actually very nice thanks Mahadeo.
string strCount= e.Row.Cells[4].Text ;
if(strCount.Length > 16)
{
e.Row.Cells[4].Text = stringFormat("{0}{1}",strCount.SubString(0,15),"...")
}
No comments:
Post a Comment