Språk: VBNästlad DataList
Jag håller på med typ av MasterDetails datalist i 3 nivåer, typ:
Nivå 1 (DataList)
Nivå 2 (DataList)
Nivå 3 (DataGrid)
KOD
****
<code>
<asp:DataList ID="dlPropertyDescriptionList" Runat="server">
<ItemTemplate>
<asp:Table ID="tblItemTemplate_0" Runat="server" CellPadding="2" CellSpacing="0" Width="100%">
<asp:TableRow>
<asp:TableCell Width="20" HorizontalAlign="Center">
<asp:Label ID="lblAccountNo" Runat="server" Text='<%# Container.DataItem("AccountNo") %>' Visible="False"/>
<asp:ImageButton ID="imgButton_AccountNo" Runat="server" ImageUrl="../images/gif/nodePlus.gif" CommandName="Show"/>
</asp:TableCell>
<asp:TableCell Width="400">
<asp:Label ID="lblPropertyDescription" Runat="server" Text='<%# Container.DataItem("PropertyDescription") %>'/>
</asp:TableCell>
<asp:TableCell Width="90">
<asp:Label ID="lblPropertyDescriptionPreliminaryCost" Runat="server" Text='<%# FormatCurrency(Container.DataItem("PreliminaryCost"), 0) %>'/>
</asp:TableCell>
<asp:TableCell Width="90">
<asp:Label ID="lblPropertyDescriptionFinalCost" Runat="server" Text='<%# FormatCurrency(Container.DataItem("FinalCost"), 0) %>'/>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell ColumnSpan="3">
<asp:DataList ID="dlPropertyList" Runat="server"
CellPadding="0"
CellSpacing="0"
Width="600"
AlternatingItemStyle-BackColor="#F5F5F5">
<HeaderTemplate>
<asp:Table ID="tblHeaderTemplate" Runat="server" CellPadding="2" CellSpacing="0" Width="100%">
<asp:TableRow CssClass="TableDataHeader">
<asp:TableCell Width="20" HorizontalAlign="Center"> </asp:TableCell>
<asp:TableCell Width="400">Populärnamn</asp:TableCell>
<asp:TableCell Width="90">Prel. kostnad</asp:TableCell>
<asp:TableCell Width="90">Slutkostnad</asp:TableCell>
</asp:TableRow>
</asp:Table>
</HeaderTemplate>
<ItemTemplate>
<asp:Table ID="tblItemTemplate_1" Runat="server" CellPadding="2" CellSpacing="0" Width="100%">
<asp:TableRow>
<asp:TableCell Width="20" HorizontalAlign="Center">
<asp:Label ID="lblPropertyID" Runat="server" Text='<%# Container.DataItem("pkPropertyID") %>' Visible="False"/>
<asp:ImageButton ID="imgButton_PropertyID" Runat="server" ImageUrl="../images/gif/nodePlus.gif" CommandName="Show"/>
</asp:TableCell>
<asp:TableCell Width="400">
<asp:Label ID="lblPopularName" Runat="server" Text='<%# Container.DataItem("Popularname") %>'/>
</asp:TableCell>
<asp:TableCell Width="90">
<asp:Label ID="lblPreliminaryCost" Runat="server" Text='<%# FormatCurrency(Container.DataItem("PreliminaryCost"), 0) %>'/>
</asp:TableCell>
<asp:TableCell Width="90">
<asp:Label ID="lblFinalCost" Runat="server" Text='<%# FormatCurrency(Container.DataItem("FinalCost"), 0) %>'/>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell ColumnSpan="3">
<asp:DataGrid ID="dgPropertyDamages" Runat="server"
AutoGenerateColumns="False"
CellPadding="2"
CellSpacing="0"
Width="100%"
HeaderStyle-CssClass="TableDataHeader"
ItemStyle-BackColor="#FFFFFF"
AlternatingItemStyle-BackColor="#F5F5F5"
BorderColor="#EEEEEE">
<Columns>
<asp:BoundColumn HeaderText="Skadedatum" DataField="DamageDate" DataFormatString="{0:d}"/>
<asp:BoundColumn HeaderText="Skadehändelse" DataField="DamageEventDescription"/>
<asp:BoundColumn HeaderText="Prel. kostnad" DataField="PreliminaryCost" DataFormatString="{0:C0}"/>
<asp:BoundColumn HeaderText="Slutkostnad" DataField="FinalCost" DataFormatString="{0:C0}"/>
<asp:BoundColumn HeaderText="Förs. skada" DataField="InsuranceDamage"/>
</Columns>
</asp:DataGrid>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:DataList>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:DataList>
</code>
Problemet är att när jag försöker köra dlPropertyList_ItemCommand händer ingenting så nu undrar jag om mitt tänk är helt fel, eller...?