You can call a custom method inside the TemplateField of the GridView as follows:
<TemplateField>
<ItemTemplate>
<%# GetSum((int)Eval(“Number1“), (int)Eval(“Number2“)) %>
</ItemTemplate>
</TemplateField>
public string GetSum(int num1, int num2)
{
return (num1+num2).ToString();
}
Hope that helps,
Regards
Tags: ASP.NET 2.0 - General