how to put value in Label inside gridview during runtime?
- by nhoyti
how to put value in Label inside gridview during runtime? I want to put dynamic values in my label inside gridview during pageload. here's my sample code
private void SplitStrings()
{
List<string> listvalues = new List<string>();
listvalues = (List<string>)Session["mylist"];
string[] strvalues = listvalues.ToArray();
if (listvalues != null)
{
foreach (string strElement in listvalues)
{
string[] test = strElement.ToString().Split("|".ToCharArray());
string prodQuantity = test[0].ToString();
foreach (GridView row in gvOrderProducts.Rows)
{
prodQuantity = ((Label)row.FindControl("lblQuantity")).Text;
}
}
}
}
i want the lblQuantity label to display the values of quantity in my gridview