Hey all. Below is the nested syntax on how to make a "codeless" nested
gridview embedded within another gridviews templatefield column. Only
problem is that it loads slow. REAL SLOW. There has to be a better way.
Suggestions anyone? By the way, I'm not opposed to coding, it just
seems like this should be easily doable on the aspx side of things.
Summary:
I'm stuffing the 3 three key fields from each row in the master
gridview into invisible labels, then pulling that data from them into
the nested sqldatasource which is in turn bound to the nested gridview.
Code:
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="t1" runat="server" Text='<%#Eval("van") %>'
Visible="false" />
<asp:Label ID="t2" runat="server" Text='<%#Eval("tcon") %>'
Visible="false" />
<asp:Label ID="t3" runat="server" Text='<%#Eval("carr") %>'
Visible="false" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:PATConnectionString %>"
SelectCommand="ww_nested" SelectCommandType="storedprocedure">
<SelectParameters>
<asp:ControlParameter ControlID="t1" Name="van" Type="string" />
<asp:ControlParameter ControlID="t2" Name="tcon" Type="string" />
<asp:ControlParameter ControlID="t3" Name="carr" Type="string" />
</SelectParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataSourceID="sqldatasource1" DataKeyNames="UID" AllowPaging="false"
AllowSorting="false">
<Columns>
<asp:BoundField DataField="UID" HeaderText="UID" ReadOnly="True"
Visible="false"/>
<asp:BoundField DataField="EVENT_DESCRIPTION" HeaderText="Event
Description" />
<asp:BoundField DataField="Event" HeaderText="Event" />
<asp:BoundField DataField="EventDt" HeaderText="EventDt" />
<asp:BoundField DataField="EventLocation" HeaderText="Location" />
<asp:BoundField DataField="ShipName" HeaderText="Ship Name" />
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:TemplateField>