今天用Gridview绑定一个超链接列HyperLinkField 文本太长想用...代替,弄了半天终于给做出来了。 平时取BoundField的Text值的时候,直接在DataBound时间里面e.Row.Cell[0].Text就行 但是HyperLinkField这样写怎么也取不到,必须把HyperLinkField列转换成HyperLink protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink hl = (HyperLink)e.Row.Cells[0].Controls[0]; if (hl.Text.Length > 20) { hl.Text = hl.Text.Substring(0, 19) + "..."; } } } 这样就能对HyperLinkField的文本进行操作了