<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "Enterprise.aspx?id="+ Eval("ID")%>'>详细</asp:HyperLink>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("ErAddDate","{0:d}") %>'></asp:Label> 指定格式
<asp:Label ID="Label1" runat="server" Text='<%# GetEpName(Eval("ErEpId")) %>'></asp:Label> 绑定数据 并附带方法
protected void GVData_RowDataBound(object sender, GridViewRowEventArgs e)
{
SDLX.Common.PublicMethod.GridViewRowDataBound(e);
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView view = e.Row.DataItem as DataRowView;
if (view != null)
{
string msg = view.Row["Remark"].ToString();
if (msg.Length > 10)
{
((Label)e.Row.Cells[0].FindControl("lbiRemark")).Text = msg.Substring(0, 9) + "....";
}
else { ((Label)e.Row.Cells[0].FindControl("lbiRemark")).Text = msg; }
((Label)e.Row.Cells[0].FindControl("lbiRemark")).ToolTip = msg;
}
}
}