To get the ListBox selected Items, i wrote like this . simillarly instead of ListBox i'm using GridView.How to write the same code.In Girdview i have some rows i want to read all the values and store it into a string datatype.
ListBox LstBox = (dgi.FindControl("lstType") as ListBox);
string strselect = "";
for (int j = 0; j < LstBox.Items.Count; j++)
{
ListItem li = LstBox.Items[j];
if (li.Selected)
{
strselect = strselect + ", " + li.Value;
}
}
GridView Selected Items
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

FroglegRank #1,020 · 1.9K reputationPosted Sep 19, 2012, 1:16 PM EDT