Thursday, October 9, 2008

Navigate throught List box using C#

System.Text.StringBuilder sbVender = new System.Text.StringBuilder();

sbVender.Append("<VENDORS>");
foreach (ListItem item in lbVendors.Items)
{
if (item.Selected)
{
sbVender.AppendFormat("<VENDOR VendorId=\"{0}\" />", item.Value.ToString());
}
}
sbVender.Append("</VENDORS>");

No comments: