Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

listview problem

$
0
0

i have a listview with access datasource, i'm trying to build a portfolio so i have used the listview to show all portfolio items(see imageb db here http://s30.postimg.org/4dw63ud1d/img1.png) however i need to use a switch case to detect if its a video or image and then i have done this:

protected void ListView6_DataBound(object sender, EventArgs e)
        {
              int i = 0;

            foreach (ListViewItem li  in ListView6.Items)

           {}
         }

but it has to read the frist row of the db OF EACH ITEM to then enter on the switch case and use string builder to build that but i cant read each row value from datasource..........

ofcource than it as to read all other values

how could i read it and apply the stringbuilder

<asp:ListView ID="ListView6" runat="server" DataSourceID="sql_ds_portefolio_items" OnDataBound="ListView6_DataBound" OnSelectedIndexChanged="ListView6_SelectedIndexChanged" DataKeyNames="id"><LayoutTemplate><asp:PlaceHolder ID="itemPlaceholder" runat="server" /></LayoutTemplate><ItemTemplate><asp:Literal ID="LiteralPortefolioItem" runat="server"></asp:Literal></ItemTemplate></asp:ListView>


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>