0
我有一個內存數據集綁定到一個ASPxGridView列名由變量確定。現在我更願意將標記中列的FieldName與相應變量的值一起分配,但<%#Eval(...)%>
會引發以下錯誤。GridViewDataTextColumn的動態字段名稱(<%#Eval(...)%>)
Parser Error Message: Databinding expressions are only supported on objects that have a DataBinding event. DevExpress.Web.ASPxGridView.GridViewDataTextColumn does not have a DataBinding event.
是否有可能一個GridViewDataTextColumn的字段名,屬性與標記的變量賦值?
從
<dx:GridViewDataTextColumn Caption="Product" FieldName="product_name">
要
<dx:GridViewDataTextColumn Caption="Product" FieldName="<%# Eval("ProductFieldName") %>">
謝謝:)我已經知道在運行時做這件事的方式。我以爲我錯過了一些東西,所以可以直接在標記中以其他方式完成。 – Andreas 2012-03-29 06:40:33