Get ListBox Multiple Selected Value

Posted On // Leave a Comment
Get ListBox multiple selected values
private string GetSelectedCategories()
    {
        string strItem=string.Empty;
        for (int i = 0; i < lbCategories.Items.Count; i++)
        {
            if (lbCategories.Items[i].Selected)
            {
                strItem += lbCategories.Items[i].Text;
            }
        }
        return strItem;
    }

0 komentar: