之前HyperLinkColumn总是无法正常使用,最后在网上找了一篇差不多的文章读了一下,终于找到了原因,同时也对HyperLinkColumn有了新的认识.
<asp:HyperLinkColumn></HyperLinkColumn>主要有以下4个主要的属性
DataTextField Gets or sets the field from a data source to bind to the text caption of the hyperlinks in the HyperLinkColumn. 获得或者设置从数据源中取得的相关数据域,绑定到HyperLinkColumn中所显示的内容上。
DataTextFormatString 获得或者设置已经帮定了数据源数据的HyperLink内容的显示格式
DataNavigateUrlField Gets or sets the field from a data source to bind to the URL of the hyperlinks in the HyperLinkColumn. 获得或者设置从数据源中取得的相关数据域,帮定到HyperLinkColumn的URL上。
DataNavigateUrlFormatString Gets or sets the display format for the URL of the hyperlinks in the HyperLinkColumn when the URL is data-bound to a field in a data source. 获得或者设置已经帮定了数据源数据的HyperLink的显示格式。
之前之所以没有数据显示,是因为没有使用DataTextField, 从而导致没有把显示内容帮定到数据源,导致没有数据库内容被显示。
而如果不用HyperLinkColumn的话,系统会默认用BoundColumn来绑定数据源,故不用指定数据源就有数据显示。
总算有显示了,接下来就只要在另外一个界面中显示相关项目的详细信息了。