M
Mike P
I have a grid view that I have formatted using table objects (see
below). But now I want to add a buttonfield within <td> tags, it will
not let me. How do I add a buttonfield?
<asp:GridView ID="GridView1" runat="server"
DataSourceID="SqlDataSource1" ShowHeader="false"
BackColor="#dddddd" DataKeyNames="ProjectID,TaskID"
AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table width="450">
<tr>
<td width="100px">
<asp:label
id="lblProjectName" Runat="server" Font-Bold="true" BackColor="Red"
ForeColor="White">PROJECT NAME</asp:label>
</td>
<td width="300px" align=left>
<asp:Label
ID="lblProjectName2" runat="server" Text='<%# Bind("ProjectName") %>'
Font-Bold="true" BackColor="red" ForeColor="White"></asp:Label>
</td>
</tr>
<tr>
<td width="100px">
<asp:label
id="lblProjectAssignedTo" Runat="server">Assigned To</asp:label>
</td>
<td width="300px" align=left>
<asp:Label
ID="lblProjectAssignedTo2" runat="server" Text='<%#
Bind("ProjectAssignedToName") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="100px">
<asp:label
id="lblProjectStartDate" Runat="server">Start Date/Time</asp:label>
</td>
<td width="300px" align=left>
<asp:Label
ID="lblProjectStartDate2" runat="server" Text='<%#
Bind("ProjectStartDate") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="100px">
<asp:label
id="lblProjectEndDate" Runat="server">End Date/Time</asp:label>
</td>
<td width="300px" align=left>
<asp:Label
ID="lblProjectEndDate2" runat="server" Text='<%# Bind("ProjectEndDate")
%>'></asp:Label>
</td>
</tr>
<tr>
<td>
//trying to add a button
field here
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
below). But now I want to add a buttonfield within <td> tags, it will
not let me. How do I add a buttonfield?
<asp:GridView ID="GridView1" runat="server"
DataSourceID="SqlDataSource1" ShowHeader="false"
BackColor="#dddddd" DataKeyNames="ProjectID,TaskID"
AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table width="450">
<tr>
<td width="100px">
<asp:label
id="lblProjectName" Runat="server" Font-Bold="true" BackColor="Red"
ForeColor="White">PROJECT NAME</asp:label>
</td>
<td width="300px" align=left>
<asp:Label
ID="lblProjectName2" runat="server" Text='<%# Bind("ProjectName") %>'
Font-Bold="true" BackColor="red" ForeColor="White"></asp:Label>
</td>
</tr>
<tr>
<td width="100px">
<asp:label
id="lblProjectAssignedTo" Runat="server">Assigned To</asp:label>
</td>
<td width="300px" align=left>
<asp:Label
ID="lblProjectAssignedTo2" runat="server" Text='<%#
Bind("ProjectAssignedToName") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="100px">
<asp:label
id="lblProjectStartDate" Runat="server">Start Date/Time</asp:label>
</td>
<td width="300px" align=left>
<asp:Label
ID="lblProjectStartDate2" runat="server" Text='<%#
Bind("ProjectStartDate") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="100px">
<asp:label
id="lblProjectEndDate" Runat="server">End Date/Time</asp:label>
</td>
<td width="300px" align=left>
<asp:Label
ID="lblProjectEndDate2" runat="server" Text='<%# Bind("ProjectEndDate")
%>'></asp:Label>
</td>
</tr>
<tr>
<td>
//trying to add a button
field here
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>