Bind dataitem properties inside the method called in templatefield of DataGrid in asp.net
<asp:DataGrid ID="overview_propertie" runat="server" AutoGenerateColumns="false"
CellPadding="0" CssClass="propertylist" GridLines="None" UseAccessibleHeader="true"
Width="100%" ShowHeader="False">
<AlternatingItemStyle CssClass="row1" />
<Columns>
<asp:BoundColumn DataField="Name" HeaderText="<%$ Resources:property%>" ItemStyle-CssClass="header">
<ItemStyle CssClass="header" />
</asp:BoundColumn>
<asp:BoundColumn DataField="Value" HeaderText="<%$ Resources:value%>" />
<asp:BoundColumn DataField="Description" HeaderText="Description" ReadOnly="true" />
<asp:TemplateColumn>
<ItemTemplate>
<table>
<tr>
<td>
<%# GetPropertyFiles(DataBinder.Eval(Container.DataItem, "ItemId"), DataBinder.Eval(Container.DataItem, "PropertyTypeId"))%>
<a class="AttachButton" href="javascript://" onclick="return AddItemPropertyFiles('<%#Eval("ItemId") %>','<%#Eval("PropertyTypeId") %>');">
Attach File</a>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid ID="overview_propertie" runat="server" AutoGenerateColumns="false"
CellPadding="0" CssClass="propertylist" GridLines="None" UseAccessibleHeader="true"
Width="100%" ShowHeader="False">
<AlternatingItemStyle CssClass="row1" />
<Columns>
<asp:BoundColumn DataField="Name" HeaderText="<%$ Resources:property%>" ItemStyle-CssClass="header">
<ItemStyle CssClass="header" />
</asp:BoundColumn>
<asp:BoundColumn DataField="Value" HeaderText="<%$ Resources:value%>" />
<asp:BoundColumn DataField="Description" HeaderText="Description" ReadOnly="true" />
<asp:TemplateColumn>
<ItemTemplate>
<table>
<tr>
<td>
<%# GetPropertyFiles(DataBinder.Eval(Container.DataItem, "ItemId"), DataBinder.Eval(Container.DataItem, "PropertyTypeId"))%>
<a class="AttachButton" href="javascript://" onclick="return AddItemPropertyFiles('<%#Eval("ItemId") %>','<%#Eval("PropertyTypeId") %>');">
Attach File</a>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>