Unable to set Gridview HyperLinkField Header using DataBinding

I’ve tried to set Gridview HyperLinkField Header text to some value using DataBinding

<%# Eval(“Rating”) %>

,but it caused error:

Gridview :Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.HyperLinkField does not have a DataBinding event. 

I had to assign Gridview HyperLinkField Header programmatically using RowDataBound event handler.

Advertisements