[Solved] Dynamic FieldName for GridViewDataTextColumn ()


No, in general. The GridViewDataTextColumn is a hierarchycal (non Data-Bound) element and it is not contained into a Data-Bound container.

According to the exception’s message, I believe this is a common situation for such an ASP.NET controls:

DataBinding expressions are only supported on objects that have a DataBinding event.

I believe it is possible to specify the required properties and assign column FieldName at runtime as it is illustrated here.

1

solved Dynamic FieldName for GridViewDataTextColumn (<%# Eval(...)%>)