please consider this code:
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton runat="server" ID="linkmodel" Text='<%#Eval("MenuItem") %>'
CommandName='<%#Eval("CommandName") %>'
OnCommand="linkmodel_Click"
OnClientClick="return confirm('Are You Sure')">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
How to add this column programmatically using C#?
thanks
This might help to get started:
But:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.templatefield.templatefield.aspx