how to call split method on designtime binding value
Hi all I have a grid with some templatecolumn , now i want to bind to on object property. one of these property is a string type that i w开发者_C百科ant split it in design time. my code is here, but i have error. i know my code is wrong. please help me if any one know the right option to do this.
<telerik:GridTemplateColumn DataField="FilePath" UniqueName="FilePath" HeaderText="نام فایل" >
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem,"FilePath.Split('-').Last();")%>
</ItemTemplate>
</telerik:GridTemplateColumn>
You need to cast our Eval
's expression to a type of string
and then call Split
method:
<ItemTemplate>
<%# ((string)Eval(FilePath)).Split('-').Last() %>
</ItemTemplate>
精彩评论