Data binding in gridview column using eval
Posted
by
ROBIN
on Stack Overflow
See other posts from Stack Overflow
or by ROBIN
Published on 2012-06-06T10:26:19Z
Indexed on
2012/06/06
10:40 UTC
Read the original article
Hit count: 294
I hava grid containing a column for displaying countrynames. I need to display value in that column as contrycode-first 10 letters of country name (in-India) .I tried it using Eval functions with in the item template:
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="CountryNameLabe" runat="server" Text='<%# Eval("CorporateAddressCountry").SubString(0,6) %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
But it shows error. Can i use custom functions in eval? please help
© Stack Overflow or respective owner