在ListView中选择项目以执行区分 [英] Selecting items in the ListView to perform Differenlty

查看:67
本文介绍了在ListView中选择项目以执行区分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在ListView中绑定了Urls Of Images的DB的ImageURL字段,然后将这些图像绑定到了ListView.它正在显示图像,但所有图像都作为一个实体工作.所以我想要将一个图像分开从其他可能与"SelectedItem"可能,但我不知道如何实现.我有以下代码的ListView

Hi,
I have ListView in which I have bind the ImageURL Field Of DB which Urls Of Images,then I have bind these images to my ListView.It is Showing Images But all Images working as A Single Entity.So What I want that to separate one image From other may be possible with "SelectedItem" but I dont Know How To implement.I have following code Of ListView

<asp:ListView ID="ListView1" runat="server" DataSourceID="LinqDataSource1" ItemPlaceholderID="ContentID"

       OnItemCommand="lst1_ItemCommand">
       <LayoutTemplate>
           <table cellpadding="0" cellspacing="0" border="0">
               <thead>
                   <tr style="background-color: Navy; color: White">
                       <th>
                           ID
                       </th>
                       <th>
                           Name
                       </th>
                       <th>
                           ImageUrl
                       </th>
                   </tr>
               </thead>
               <tbody runat="server" id="ContentID">
               </tbody>
           </table>
       </LayoutTemplate>
       <ItemTemplate>
           <tr>
               <td>
                   <%# Eval("ID") %>
               </td>
               <td>
                   <%# Eval("Name") %>
               </td>
               <td>
                   <asp:ImageButton AlternateText="ALi" ID="Imgbtn1" runat="server" ImageUrl='<%# Bind("ImageUrl") %>'

                       Width="75px"  />
               </td>
           </tr>
       </ItemTemplate>
   </asp:ListView>

推荐答案

也许您应该考虑使用Silverlight.在那里,您可以创建控件模板,并使用转换器将正确的模板放入列表框项目视图.
Maybe you should consider Silverlight. There you can create controltemplates, and use a converter to put the right template into the listbox item view.


这篇关于在ListView中选择项目以执行区分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆