可以调用BoundColumn.DataField中的函数吗?
-
03-07-2019 - |
题
<asp:BoundColumn DataField="pos" HeaderText="Principal Office" />
有可能以某种方式......
<asp:BoundColumn DataField="postProccess(pos)" HeaderText="Principal Office" />
...所以我可以根据需要修改值吗?
CRAP:
A field or property with the name 'postProcess(pos)' was not found on the selected data source.
任何人都知道如何覆盖那件事或什么?
解决方案
以下是您要用于模板列的完整代码段...
<asp:TemplateColumn HeaderText="Principal Office">
<ItemTemplate>
<%# postProcess(Eval("pos")) %>
<ItemTemplate>
<asp:TemplateColumn>
其他提示
使用 <asp:templatecolumn>
并在ItemDataBound
事件
不隶属于 StackOverflow