Hi, I have a datagrid and an itemtemplate in it. I want to assign a skindID to the item template, but I get the following error:
Type System.Web.UI.WebControls.LinkButton already has a default theme defined.
Here is the datagrid:
<asp:DataGrid ID="grdPage" runat="server" AlternatingItemStyle-CssClass="row2"
AutoGenerateColumns="false" BorderColor="#88B2C8" CellPadding="2" DataKeyField="row_id"
GridLines="Both" HeaderStyle-CssClass="header" ItemStyle-CssClass="row1" OnItemCommand="page_OnItemCommand"
Width="100%">
<Columns>
<asp:BoundColumn DataField="row_id" HeaderText="#"></asp:BoundColumn>
<asp:BoundColumn DataField="col1" HeaderText="col1"></asp:BoundColumn>
<asp:BoundColumn DataField="col2" HeaderText="col2"></asp:BoundColumn>
<asp:BoundColumn DataField="col3" HeaderText="col3"></asp:BoundColumn>
<asp:BoundColumn DataField="col4" HeaderText="col4"></asp:BoundColumn>
<asp:BoundColumn DataField="col5" HeaderText="col5"></asp:BoundColumn>
<asp:BoundColumn DataField="col6" HeaderText="col6"></asp:BoundColumn>
<asp:BoundColumn DataField="col7" HeaderText="col7"></asp:BoundColumn>
<asp:BoundColumn DataField="col8" HeaderText="col8"></asp:BoundColumn>
<asp:BoundColumn DataField="col9" HeaderText="col9"></asp:BoundColumn>
<asp:BoundColumn DataField="col10" HeaderText="col10"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Actions" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton SkinID="cmdEdit" ID="cmdEdit" CommandName="Edit" runat="server" />
<asp:LinkButton SkinID="cmdDelete" ID="cmdDelete" CommandName="Delete" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
I only have two items in the .skin file for link buttons:
<asp:LinkButton runat="server" SkindID="cmdEdit" Text="<img border=0 src='App_Themes/page1/images/cmdEdit.gif'/>"></asp:LinkButton>
<asp:LinkButton runat="server" SkindID="cmdDelete" Text="<img border=0 src='App_Themes/page1/images/cmdDelete.gif'/>"></asp:LinkButton>
Why does it tell me that is has already a default?
Is it possible to use skin files within itemtemplates and if not, how can I add this itemtemplaate diagrammatically to my the datagrid?
Thanks, Patrick