开发者

Calling a method on DataBound field 's DataField

开发者 https://www.devze.com 2023-03-25 17:44 出处:网络
I want to call a method on databound field on datafield. e.g. <asp:BoundField DataField=\"TitlePLang\"HeaderText=\"Batch Title\"/> This is simple bound field but I want to do something like thi

I want to call a method on databound field on datafield. e.g.

<asp:BoundField DataField="TitlePLang"  HeaderText="Batch Title"  /> This is simple bound field but I want to do something like this.

<asp:BoundField DataField='<%# Eval(getCultureSpecificTitle("TitlePLang","TitleSLang",true))%>'  HeaderText="Batch Title"  />

Where getCultureSpecificTitle is a method in code behind, but its giving error that bound field doesn't allow data binding.

So please开发者_运维问答 help how can I do this....


Well this is not possible using the bind files but you can make use of the TempalteField avaialbe in the grid view will allows you to do this easily.

If you want to achieve same from the code behind than you make use of OnRowDataBound event available for the datagrid view will do the work for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消