Method 1: css processing:
A
{
Width: 80px;
Overflow: hidden;/* do not write it at the end */
White-space: nowrap;
-O-text-overflow: ellipsis;
Text-overflow: ellipsis;
}
A: hover
{
Text-decoration: none;
Color: #000;
}
<A href = "#" style = "display: block; text-decoration: none; color: #000;" title = '<% # Eval ("GlobalCode ") %> '> <% # Eval ("GlobalCode") %> </a>
Method 2: server-side truncation
In GridViewTicket_RowDataBound and other events:
String Destination Address = dtHotel. Rows [row. RowIndex] ["Destination _address"]. ToString (). Trim ();
If (response address. Length> 9)
{
(Label) row. FindControl ("labelemediaddress"). Text = your address. Substring (0, 8) + "...";
(Label) row. FindControl ("labelemediaddress"). ToolTip = your address;
}
Else
{
(Label) row. FindControl ("labelemediaddress"). Text = your address;
(Label) row. FindControl ("labelemediaddress"). ToolTip = your address;
}