0
我認爲自己處於GridView的中間級別。到目前爲止,我對它的理解對我來說很簡單,那就是直到我認爲我需要使用InsertItemTemplate。我可以使用頁腳做我的「添加新記錄」,但我有19個字段,我需要用戶輸入數據,我想把它全部放到一個使用a格式化的列中。它在EditItemTemplate和EmptyDataTemplate中工作並且看起來很棒。我只是無法弄清楚如何讓InsertItemTemplate中的控件顯示出來。如果我能弄明白如何格式化頁腳,只顯示/使用一個寬列我會使用,因爲我瞭解頁腳,並使用它很多到這一點。如何讓InsertItemTemplate中的控件顯示在GridView中
任何方式,這是我的網格。我對尺碼錶示歉意。有很多領域。
<InsertItemTemplate>
<table width="100%" class="tdSilver" id="tblAdd">
<tr>
<th style="width: 15%; text-align: left">
<asp:Label runat="server" ID="lbllocationName_add" Text="Location Name" />
</th>
<th style="width: 20%; text-align: left">
<asp:Label runat="server" ID="lblassType_add" Text="Review Type" />
</th>
<th style="width: 20%; text-align: left">
<asp:Label runat="server" ID="lblrelatedCISE" Text="Related CISE" />
</th>
</tr>
<tr class="altRow">
<td align="left">
<asp:TextBox runat="server" ID="txtlocationName_add" Text="" Width="85%" MaxLength="200" />
<br />
<asp:RequiredFieldValidator runat="server" ID="vallocationName_add" ControlToValidate="txtlocationName_add"
ErrorMessage="Location Name Required" Font-Bold="true" ForeColor="Red" Display="Dynamic" />
</td>
<td align="left">
<asp:DropDownList runat="server" ID="ddlassTypeId_add" DataTextField="assType" DataValueField="assTypeId"
Width="85%" />
<br />
<asp:RequiredFieldValidator ID="valddlassTypeId_add" runat="server" ControlToValidate="ddlassTypeId_add"
InitialValue="-1" Display="Dynamic" ErrorMessage="Required" Font-Bold="true"
ForeColor="Red" />
</td>
<td align="left">
<asp:DropDownList runat="server" ID="ddlrelatedCISE_add" DataTextField="assType"
DataValueField="assTypeId" Width="85%" />
<br />
<asp:RequiredFieldValidator ID="valddlrelatedCISE_add" runat="server" ControlToValidate="ddlrelatedCISE_add"
InitialValue="-1" Display="Dynamic" ErrorMessage="Required" Font-Bold="true"
ForeColor="Red" />
</td>
</tr>
<tr>
<th style="text-align: left">
<asp:Label runat="server" ID="lblvendorLocationTypeId_add" Text="Site Type" />
</th>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lbllocationDesc_add" Text="Site Description" />
</th>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lblcancelled_add" Text="Site Cancelled" />
</th>
</tr>
<tr class="altRow">
<td valign="top" align="left">
<asp:DropDownList runat="server" ID="ddlvendorLocationTypeId_add" DataTextField="vendorLocationType"
DataValueField="vendorLocationTypeId" Width="85%" />
<br />
<asp:RequiredFieldValidator ID="valddlvendorLocationTypeId_add" runat="server" ControlToValidate="ddlvendorLocationTypeId_add"
InitialValue="0" Display="Dynamic" ErrorMessage="Required" Font-Bold="true" ForeColor="Red" />
</td>
<td align="left">
<asp:TextBox runat="server" ID="txtlocationDesc_add" Text="" TextMode="MultiLine"
MaxLength="500" Rows="4" Width="85%" />
<br />
<asp:CustomValidator ID="valtxtlocationDesc_add" runat="server" ErrorMessage="Max length of Location Desc exceeded 500 characters."
Font-Strikeout="False" ControlToValidate="txtlocationDesc_add" SetFocusOnError="True"
OnServerValidate="MaxLengthTest" Font-Bold="True" Display="Dynamic"></asp:CustomValidator>
</td>
<td valign="top" align="left">
<asp:CheckBox runat="server" ID="chbcancelled_add" Text="Site Cancelled" AutoPostBack="False"
CssClass="ispaCheckBoxes" Font-Bold="false" Width="85%" onclick="ToggleCancelledWarning();" />
<br />
<asp:Label ID="lblCancelledReason_add" runat="server" Text="Reason for Cancellation" />
<br />
<asp:TextBox ID="txtCancelledReason_add" runat="server" Text="" TextMode="MultiLine"
Rows="3" Width="85%" onchange="ToggleCancelledWarning();" />
<br />
<asp:CustomValidator ID="valtxtCancelledReason_add" runat="server" ErrorMessage="Max length of Reason exceeded 500 characters."
Font-Strikeout="False" ControlToValidate="txtCancelledReason_add" SetFocusOnError="True"
OnServerValidate="MaxLengthTest" Font-Bold="True" Display="Dynamic"></asp:CustomValidator>
<br />
<asp:Label runat="server" ID="lblCancelledReasonWarning" Text="" Font-Bold="true"
ForeColor="Red" Visible="true" />
</td>
</tr>
<tr>
<th style="text-align: left">
<asp:Label runat="server" ID="lblsiteScopeId_add" Text="Site Scope" />
</th>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lblapplicationName_add" Text="Application Name" />
</th>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lblapplicationURL_add" Text="Application URL" />
</th>
</tr>
<tr class="altRow">
<td valign="top" align="left">
<asp:DropDownList runat="server" ID="ddlsiteScopeId_add" DataTextField="siteScopeName"
DataValueField="siteScopeId" Width="85%" />
<br />
<asp:RequiredFieldValidator ID="valddlsiteScopeId_add" runat="server" ControlToValidate="ddlsiteScopeId_add"
InitialValue="0" Display="Dynamic" ErrorMessage="Required" Font-Bold="true" ForeColor="Red" />
</td>
<td align="left">
<asp:TextBox runat="server" ID="txtapplicationName_add" Text="" Width="85%" MaxLength="100" />
</td>
<td align="left">
<asp:TextBox runat="server" ID="txtapplicationURL_add" Text="" Width="85%" MaxLength="100" />
</td>
</tr>
<tr>
<th style="text-align: left">
<asp:Label runat="server" ID="lblvendorStreet_add" Text="Street" />
</th>
<th style="text-align: left">
<asp:Label runat="server" ID="lblvendorCity_add" Text="City" />
</th>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lblvendorZip_add" Text="Zip" />
</th>
</tr>
<tr class="altRow">
<td align="left">
<asp:TextBox runat="server" ID="txtvendorStreet_add" Text="" Width="85%" MaxLength="100" />
<br />
<asp:RequiredFieldValidator ID="valtxtvendorStreet_add" runat="server" ControlToValidate="txtvendorStreet_add"
Display="Dynamic" ErrorMessage="Required" Font-Bold="true" ForeColor="Red" />
</td>
<td align="left">
<asp:TextBox runat="server" ID="txtvendorCity_add" Text="" Width="85%" MaxLength="100" />
<br />
<asp:RequiredFieldValidator ID="valtxtvendorCity_add" runat="server" ControlToValidate="txtvendorCity_add"
Display="Dynamic" ErrorMessage="Required" Font-Bold="true" ForeColor="Red" />
</td>
<td align="left">
<asp:TextBox runat="server" ID="txtvendorZip_add" Text="" Width="85%" MaxLength="20" />
</td>
</tr>
<tr>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lblvendorProvidence_add" Text="Providence" />
</th>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lblstateId_add" Text="State" />
</th>
<th style="text-align: left">
<asp:Label runat="server" ID="lblcountryId_add" Text="Country" />
</th>
</tr>
<tr class="altRow">
<td align="left">
<asp:TextBox runat="server" ID="txtvendorProvidence_add" Text="" Width="85%" MaxLength="100" />
</td>
<td align="left">
<asp:DropDownList ID="ddlstateId_add" runat="server" Width="85%" DataTextField="stateAbbv"
DataValueField="stateId" />
</td>
<td align="left">
<asp:DropDownList runat="server" ID="ddlcountryId_add" DataTextField="countryName"
DataValueField="countryId" Width="85%" />
<br />
<asp:RequiredFieldValidator ID="valddlcountryId_add" runat="server" ControlToValidate="ddlcountryId_add"
InitialValue="0" Display="Dynamic" ErrorMessage="Required" Font-Bold="true" ForeColor="Red" />
</td>
</tr>
<tr>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lblfieldAssessorUsrId_add" Text="Assign Field Assessor" />
</th>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lblreviewStartDate_add" Text="Arrive On" />
</th>
<th style="text-align: left; font-weight: normal">
<asp:Label runat="server" ID="lblreviewEndDate_add" Text="Depart On" />
</th>
</tr>
<tr class="altRow">
<td align="left">
<asp:DropDownList runat="server" ID="ddlfieldAssessorUsrId_add" DataTextField="usrFullName"
DataValueField="usrID" Width="85%" />
</td>
<td style="vertical-align: text-top; text-align: left">
<telerik:RadDatePicker runat="server" ID="dtereviewStartDate_add" Calendar-EnableMultiSelect="False"
Calendar-EnableMonthYearFastNavigation="True" Width="85%" />
</td>
<td style="vertical-align: text-top; text-align: left">
<telerik:RadDatePicker runat="server" ID="dtereviewEndDate_add" Calendar-EnableMultiSelect="False"
Calendar-EnableMonthYearFastNavigation="True" Width="85%" />
</td>
</tr>
<tr>
<td colspan="3" style="text-align: left">
<asp:LinkButton ID="lnkBtnAdd_add" runat="server" Text="Insert New" CommandName="EmptyInsert"
CausesValidation="True"></asp:LinkButton>
</td>
</tr>
</table>
</InsertItemTemplate>
實際上,微軟如何在SharePoint 2010上實現它,有一個鏈接插入項目點擊它,然後模態對話框似乎輸入您的數據,然後保存它。 如果你能做到這一點,那麼你在這裏擊敗微軟:) –