Hi , I have a listview control with Click Button. I want that if i click on a button then it should get all the data of that row on the basis of Unique ID of that Selected Row. I want it via ListView Property. I have one other method , when i click on Button of any Selected Row then it gets ID of that row in ItemCommand Event of ListView and from here I can call Sql query to get all the columns value of that ID. But I want it without doing this. Kindly help me out. Here is my code below:--
No Images found.
Zoom
<%--<%#Eval("ImageTitle") %>--%>
<%#Eval("SellingPrice") %>
<%-- Add to cart--%>
<%--
--%>
protected void ImagesList_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "ImgTitle")
{
string shopname = e.CommandArgument.ToString();
Response.Redirect("Item.aspx?vid="+shopname);
}
if (e.CommandName == "AddToCart")
{
int id = Convert.ToInt32(e.CommandArgument);
DataRow[] dr = dt.Select("ID="+id);
// ServiceName,ServiceImage,SellingPrice,MRP
string serviceName = dr[1]["ServiceName"].ToString();
string serviceImage = dr[1]["ServiceImage"].ToString();
float sellingPrice = Convert.ToInt64(dr[1]["SellingPrice"].ToString());
float mrp = Convert.ToInt64(dr[1]["SellingPrice"].ToString());
}
}