1

私はこれを約1日グーグルで検索していますが、見つけたすべての投稿は古すぎて、Visual Studioは人々が投稿したコードの一部を認識しません. 動的に取り込まれた Listview があります。読みやすくするために、他のすべての行に影を付けたいのですが、それがわかりません。

私がしようとすることはすべて、リストビュー内にあるモーダル PopupExtender を台無しにします。PopUpBox 内の線にも影を付けようとします。これは、シェーディングしたいリストビューの 1 つです。

<!-- Descriptions -->
<asp:TabPanel ID="tab2"  runat="server" HeaderText="Descriptions">
<HeaderTemplate>Descriptions</HeaderTemplate>
    <ContentTemplate>
        <ul class="info">
        <asp:ListView ID="lvDescriptions" runat="server" DataSourceID="dsMarketingDescriptions" DataKeyNames="MarketingID">
        <ItemTemplate>
            <li>
                <asp:LinkButton ID="ViewDescriptionButton" runat="server"><%#Eval("MarketingTitle")%></asp:LinkButton>
                <asp:Panel ID="ViewDescriptionPanel" runat="server" CssClass="DescModalPopup">                   <div class="PopupHeader" id="PopupHeader">View Description
                <asp:ImageButton ID="CancelDescriptionButton" runat="server" ImageUrl="../../images/exit.png" AlternateText="" Style="float:right;"/>
                </div>
                    <asp:Label ID="Description" runat="server" style="padding:5px;"><%# Eval("MarketingData") %></asp:Label>
                </asp:Panel> 
                <asp:ModalPopupExtender ID="ViewDescriptionModal" runat="server" BackgroundCssClass="modalBackground" DropShadow="false" DynamicServicePath="" Enabled="true" PopupControlID="ViewDescriptionPanel" TargetControlID="ViewDescriptionButton" CancelControlID="CancelDescriptionButton"></asp:ModalPopupExtender>              
            </li>
        </ItemTemplate>
        </asp:ListView>
        </ul>
    </ContentTemplate>
</asp:TabPanel>

ここに画像の説明を入力

4

1 に答える 1

1

Try using the AlternatingItemTemplate to specify a different background color for alternating items.

Are you trying to do something like this with the ModalPopupExtender?:

protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
    Panel pnl = e.Item.FindControl("Panel1") as Panel;
    if (pnl != null)
    {
        pnl.BackColor = ListView1.Items.IndexOf(e.Item) % 2 == 1 ? Color.PeachPuff : Color.White;
    }
}
于 2011-09-14T18:42:38.753 に答える