Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Select an item from listview

$
0
0

I have a listview that contains items and each item has itemname and item price... when I select an item in the listview I need to get the name of this item how can I do this?

...<tr><td><asp:Label ID="Label8" Font-Size="Large" runat="server" Text="Item name:"  style="text-align:left" ></asp:Label><asp:Label ID="Label4" Font-Size="Large"  ForeColor="#CC3300" runat="server" Text='<%# Eval("ItemName") %>' style="text-align:left; font-style:italic;"></asp:Label></td></tr>
...

and the listview is filled like that:

try
                {
                    string con = ConfigurationManager.ConnectionStrings["DatabaseConnection"].ConnectionString;
                    SQLiteConnection cnn = new SQLiteConnection(con);
                    cnn.Open();
                    SQLiteDataAdapter com;  // create command
                    com = new SQLiteDataAdapter("Select * from Items where ItemCategory like '" + category + "' and ItemGroup like '" + group + "'", cnn);
                    DataSet ds = new DataSet();
                    com.Fill(ds);
                    ListView1.DataSource = ds;
                    ListView1.DataBind();
                    cnn.Close();
                }


Viewing all articles
Browse latest Browse all 3509

Trending Articles



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