我有两个ListBoxes . 首先 ListBox
项目是"Products"的列表 . 和第二个 ListBox
项目是"Item in Product"的列表所以当用户单击第一个(产品)列表框中的项目时,第二个 ListBox
将显示所选产品中的项目列表 .
例如:
Products Items in Proucts
AA* 1
BB 2
CC 3
在上面的例子当前用户选择AA产品 . 1,2,3是产品AA中的项目 .
对于当前的计划,我已经完成了 . 用户 only can select One "Products" at a time . 然后我想 change to multipleselected. 所以我想得到用户选择的每个产品的索引号,然后我可以从数据库中检索数据以获得所有选定产品的"Items In Products" .
if (productsListBox.SelectedItmes.Count >= 0)
{
// please provide me coding here to get index number for each selected items in productListBox.
}
3 回答
它会为您提供所选ID的CSV
我已经得到了答案: