//证件号码
//鼠标悬停显示Label文本完整信息
//txtIDCardNo既是文本Label的Id
((Label)(txtIDCardNo.FindControl("txtIDCardNo"))).ToolTip = item.IDCardNo;
//将Label文本值的最后四位用“****”代替
this.txtIDCardNo.Text = item.CardNo.Substring(0, item.CardNo.Length - 4) + "****";
/// <summary>
/// 超出文本用“...”代替,鼠标悬停显示完整信息
/// </summary>
private void Load_Text()
{
//超出文本用“...”代替,鼠标悬停显示完整信息
//"lbl_BDDH", "lbl_LXJG" 既是文本GridViewl的列Id
string[] str = new string[] { "lbl_BDDH", "lbl_LXJG" };
for (int i = 0; i < gvBankData.Rows.Count; i++)
{
for (int j = 0; j < str.Length; j++)
{
((Label)gvBankData.Rows[i].FindControl(str[j])).ToolTip = ((Label)gvBankData.Rows[i].FindControl(str[j])).Text;
if (((Label)gvBankData.Rows[i].FindControl(str[j])).Text.Length > 10)
{
((Label)gvBankData.Rows[i].FindControl(str[j])).Text = ((Label)gvBankData.Rows[i].FindControl(str[j])).Text.Substring(0, 10) + "...";
}
}
}
}