nightscorpion
June 30th, 2009, 06:26 PM
Hello Guys ,
i have a small problem here with my list . i display only an EA.Element names in my checklist box . When a user selects a name of the BC i would like to pass the whole element as a parameter to my event handler and i do not have much idea how this work. Would be really gratefull for any help
case "includedinBC":
list = new ArrayList();
ArrayList BClist;
BClist = utility.getBCollUCs(repo); // get all Business Collaborations
list = utility.getIncludedBC(element, repo); // Get included BC
foreach (object o in BClist)
{
EA.Element Bcollaboration = (EA.Element)o;
checkListBox.Items.Add(Bcollaboration.Name);
}
for (int i = 0; i < BClist.Count; i++)
{
EA.Element bcoll = (EA.Element)BClist[i];
for (int j = 0; j < list.Count; j++)
{
EA.Element client = (EA.Element)list[j];
if (client.Name.Equals(bcoll.Name))
{
checkListBox.SetItemChecked(i, true);
}
}
// include a BC which is not included
checkListBox.ItemCheck += new ItemCheckEventHandler(clb_ItemCheck);
}
break;
here is my event handler
private void clb_ItemCheck(object sender, ItemCheckEventArgs e)
{
CheckedListBox checklistBox = (CheckedListBox)sender;
String includedBC = (String)checklistBox.SelectedItem;
// i would like to get the EA.Element of the Selected Item....!!!?????
}
i have a small problem here with my list . i display only an EA.Element names in my checklist box . When a user selects a name of the BC i would like to pass the whole element as a parameter to my event handler and i do not have much idea how this work. Would be really gratefull for any help
case "includedinBC":
list = new ArrayList();
ArrayList BClist;
BClist = utility.getBCollUCs(repo); // get all Business Collaborations
list = utility.getIncludedBC(element, repo); // Get included BC
foreach (object o in BClist)
{
EA.Element Bcollaboration = (EA.Element)o;
checkListBox.Items.Add(Bcollaboration.Name);
}
for (int i = 0; i < BClist.Count; i++)
{
EA.Element bcoll = (EA.Element)BClist[i];
for (int j = 0; j < list.Count; j++)
{
EA.Element client = (EA.Element)list[j];
if (client.Name.Equals(bcoll.Name))
{
checkListBox.SetItemChecked(i, true);
}
}
// include a BC which is not included
checkListBox.ItemCheck += new ItemCheckEventHandler(clb_ItemCheck);
}
break;
here is my event handler
private void clb_ItemCheck(object sender, ItemCheckEventArgs e)
{
CheckedListBox checklistBox = (CheckedListBox)sender;
String includedBC = (String)checklistBox.SelectedItem;
// i would like to get the EA.Element of the Selected Item....!!!?????
}