我正在尝试使用 javascript 或 JQuery 将网格视图转换为 DataTable。可以请一些人帮助这个请求。请注意,由于服务器限制,我无法使用 AJAX。请注意,我有模板字段和绑定字段作为网格列。
<asp:GridView ID="grdcloneProgoffers" runat="server" CssClass="mGrid" Width="98%" AutoGenerateColumns="false"
Visible="true" >
<Columns>
<asp:TemplateField HeaderText="Offerid" Visible="false">
<ItemTemplate>
<asp:Label ID="lblOfferId" runat="server" Text='<%#Eval("OFFER_ID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Offer Name">
<ItemTemplate>
<asp:Label ID="lblOfferName" runat="server" Text='<%#Eval("OFFER_NAME") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PS-R" HeaderStyle-Width="5%">
<ItemTemplate>
<asp:Label ID="lblPreSelected" runat="server" Text='<%#Eval("PRE_SELECTED_REQ") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PS-O" HeaderStyle-Width="5%">
<ItemTemplate>
<asp:Label ID="lblPreSelectedNot" runat="server" Text='<%#Eval("PRE_SELECTED_NOT_REQ") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="O">
<ItemTemplate>
<asp:Label ID="lblOptional" runat="server" Text='<%#Eval("OPTIONAL") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Eligibility_GM" HeaderText="Eligibility GM" />
<asp:BoundField DataField="Eligibility_EE" HeaderText="Eligibility EE" />
<asp:BoundField DataField="Eligibility_WD" HeaderText="Eligibility WD" />
<asp:BoundField DataField="Eligibility_MDUBULK" HeaderText="Eligibility MDUBULK" />
<asp:BoundField DataField="SERVICE_CODE" HeaderText="Service Code" />
<asp:BoundField DataField="PRICE_CODE" HeaderText="Price Code" />
<asp:BoundField DataField="OFFER_STATE" HeaderText="Staged State" />
<asp:BoundField DataField="Compliance_GM" HeaderText="Compliance GM" />
<asp:BoundField DataField="Compliance_EE" HeaderText="Compliance EE" />
<asp:BoundField DataField="Compliance_WD" HeaderText="Compliance WD" />
<asp:BoundField DataField="Compliance_MDUBULK" HeaderText="Compliance MDUBULK" />
<%-- <asp:TemplateField HeaderText="Tags">
<ItemTemplate>
<asp:Label ID="lbltags" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>--%>
</Columns>
<HeaderStyle CssClass="header" Height="20px" />