我需要以图片中所附的确切格式在网格视图中显示我的数据。除了插入按钮之外,我已经准备好了所有东西。此按钮将出现在同一焦点区域的最后一行,即如果我有两行焦点区域为“客户端”,则插入行按钮将出现在第二行而不是所有行。1
任何帮助将不胜感激。
谢谢!
<asp:GridView ID="grdMBO" runat="server" AutoGenerateColumns="false" OnRowDataBound="grdMBO_RowDataBound"
OnRowCommand="grdMBO_RowCommand" DataKeyNames="ID">
<Columns>
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<asp:Label ID="lblMBOID" runat="server" Text='<%# Eval("MBOToolID") %>'></asp:Label>
<asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Performance Focus Area">
<ItemTemplate>
<asp:TextBox ID="txtFocusArea" Text='<%# Eval("PerformanceFocusArea") %>' Visible="false"
runat="server"></asp:TextBox>
<asp:DropDownList ID="drpFocusArea" runat="server">
<asp:ListItem Value="Client"></asp:ListItem>
<asp:ListItem Value="Commercial Management"></asp:ListItem>
<asp:ListItem Value="Ideas"></asp:ListItem>
<asp:ListItem Value="People"></asp:ListItem>
<asp:ListItem Value="Specific and Unique Capabilities"></asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="In Year or Multi Year">
<ItemTemplate>
<asp:Label ID="lblYearSelected" Visible="false" runat="server" Text='<%# Eval("SelectedYear") %>'></asp:Label>
<asp:RadioButtonList ID="radGoals" runat="server">
<asp:ListItem Text="In Year" Value="1"></asp:ListItem>
<asp:ListItem Text="Multi Year" Value="2"></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Goal**">
<ItemTemplate>
<asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" Text='<%# Eval("AnnualGoal") %>'
Rows="5" Width="250px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Goal Team" HeaderStyle-Width="500px">
<ItemTemplate>
<table width="100%">
<tr>
<td style="width: 45%" valign="top">
<i>Please enter name & wait for Auto-Suggestion</i>
<asp:TextBox ID="txtName" Width="80%" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="autoComp" runat="server" MinimumPrefixLength="2" TargetControlID="txtName"
ServiceMethod="GetNames" CompletionListCssClass="AjaxRecordDisplay" CompletionListHighlightedItemCssClass="AjaxHighlightRecord"
CompletionListItemCssClass="AjaxItemDisplay" Enabled="true" ServicePath="WebService.asmx">
</cc1:AutoCompleteExtender>
</td>
<td style="width: 10%">
<%-- <input type="button" id="btnSelectName" runat="server" value=">>" />--%>
<asp:Button ID="btnSelectName" runat="server" Text=">>" />
</td>
<td style="width: 45%">
<asp:ListBox ID="lstSelectedName" Width="80%" runat="server"></asp:ListBox>
<asp:HiddenField ID="hdnSelectedName" runat="server" />
<i>(Double click to remove name)</i>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TT Feedback">
<ItemTemplate>
<asp:TextBox ID="txtTTComments" runat="server" TextMode="MultiLine" Rows="5" Width="250px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<asp:ImageButton ID="imgAdd" runat="server" Width="20px" CommandArgument='<%#DataBinder.Eval(Container,"DataItem.ID") %>'
CommandName="Add" Height="20px" ImageUrl="~/Layout/Images/Add.jpg" />
<%-- <asp:ImageButton ID="imgDelete" runat="server" Width="20px" Height="20px" ImageUrl="~/Layout/Images/Delete.jpg" />--%>
<img src="~/Layout/Images/Delete.jpg" id="imgDelete" style="height: 20px; width: 20px;
cursor: pointer" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>