Hello
I've got the following Problem:
I want to add a Templatefield at a specific column in a Gridview. Is this possible somehow without too much effort? I tried tons of things but haven't found a solution yet.
the thing is, that I add most columns via VB code. I have about 10 columns now. and now I want to add a templatefield to Column 11, because I need to use the "onClientClick" event for calling a JavaScript.
this is my gridview with a templatefield
<asp:GridView ID="gvLizenzUebersicht" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:linkbutton ID="lb1" Text="<img src='../images/WebIcons/Computer_File_106.gif' border=0 title='Delete'>" runat="server" OnClientClick="return confirm('Möchten Sie wirklich löschen?');" CommandName="Delete"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
this is how I add and fill columns via VB
gvLizenzdateien.AllowSorting = False
gvLizenzdateien.PageSize = 20
gvLizenzdateien.AllowPaging = False
gvLizenzdateien.AutoGenerateColumns = False
SetEditCol(gvLizenzdateien)
addField("DateiID", "DateiID", "DateiID", True, gvLizenzdateien)
addField("ContentType", "ContentType", "ContentType", True, gvLizenzdateien)
addField("Dateiname", "Dateiname", "Dateiname", True, gvLizenzdateien)
addField("Bezeichnung", "Bezeichnung", "Bezeichnung", True, gvLizenzdateien)
addField("Filesize", "Filesize in bytes", "Filesize", True, gvLizenzdateien)
addField("Ersteller", "Uploader", "Ersteller", True, gvLizenzdateien)
SetCheckBoxCol(gvLizenzdateien, "Select", True, True, "Aktiv")
SetGridData()
would be awesome if there was a way to set a templatefield in the last column without rewriting all my "addfields" to other templatefields......:(
thanks for the help!