المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : change Items selected in a listbox in runtime



C# Programming
02-01-2010, 05:41 PM
I have a treeview and a listbox. For each node, there are some related items in the listbox. I want when the selected node in treeview changes, the items selected in the listbox change too based on the selected treeview node. How can I do that? Briefly, I want that the collection of the selected items in the listbox change in runtime.
I used a code like this:

foreach (DataRowView i in listBox_WorkOverOperationWhichinHole.Items)
{

}

but I do not know what to do next is it a true way to do that!
Thanks a lot in advance!