[英]How to give css to tooltip in asp.net?
protected void grd_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
foreach (TableCell cell in e.Row.Cells)
{
string cellText = e.Row.Cells[5].Text;
if (cell.Text.Length > 10)
{
cell.Text = cell.Text.Substring(0, 10) + "....";
cell.ToolTip = cellText;
}
}
}
}
From the above method we have tooltip on every columns in the table. 通过上面的方法,我们在表的每个列上都有工具提示。 Below code shows that 6th column will only populate tooltip.
下面的代码显示第6列将仅填充工具提示。
<script type="text/javascript">
$(document).ready(function() {
focus.($("#grdStudentList td:nth-child(6)"));
});
</script>
How i will give css to this focus which display as tooltip. 我将如何使CSS成为焦点,显示为工具提示。
请检查所有单词是否包含超过10个字符
( if (cell.Text.Length > 10)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.