Multi Select From A Search List On A Wizard
Tue 28 Jan 2020 - 9:16
Hi all,
I have a search list control placed on a wizard, multi select is enabled. I was wondering how to access the values of the selected items in code?
Thanks
,Gareth
__________________________________________________________________________________________________________________________________
Danny
Cheers for the quick response. I've given it a go and get an 'object reference not set to an instance of an object' error. Just to clarify what I am attempting, I have put this code in the finished event of the wizard.
__________________________________________________________________________________________________________________________________
Hi
Just to confirm. What was the name of the SearchList you put on the wizard. If it is different that SearchList1 then you need to change that part of the code.
Regards
Danny
__________________________________________________________________________________________________________________________________
it is schLayWitnesses, code as follows
It's OK! Fixed!I hadn't changed the name of the key I required from the KVC e.g. changing yours from “ID” to "AssocID".
Thanks for your help with this.Gareth
I have a search list control placed on a wizard, multi select is enabled. I was wondering how to access the values of the selected items in code?
Thanks
,Gareth
__________________________________________________________________________________________________________________________________
- Code:
FWBS.OMS.UI.Windows.ucSearchControl s = EnquiryForm.GetControl("SearchList1") as FWBS.OMS.UI.Windows.ucSearchControl;
foreach (KeyValueCollection kvc in s.SelectedItems)
{
System.Windows.Forms.MessageBox.Show(Convert.ToString(kvc["ID"].Value));
}
Danny
Cheers for the quick response. I've given it a go and get an 'object reference not set to an instance of an object' error. Just to clarify what I am attempting, I have put this code in the finished event of the wizard.
__________________________________________________________________________________________________________________________________
Hi
Just to confirm. What was the name of the SearchList you put on the wizard. If it is different that SearchList1 then you need to change that part of the code.
Regards
Danny
__________________________________________________________________________________________________________________________________
it is schLayWitnesses, code as follows
- Code:
FWBS.OMS.UI.Windows.ucSearchControl s = EnquiryForm.GetControl("schLayWitnesses") as FWBS.OMS.UI.Windows.ucSearchControl;
foreach (KeyValueCollection kvc in s.SelectedItems)
{
System.Windows.Forms.MessageBox.Show(Convert.ToString(kvc["ID"].Value));
}
It's OK! Fixed!I hadn't changed the name of the key I required from the KVC e.g. changing yours from “ID” to "AssocID".
Thanks for your help with this.Gareth
Permissions in this forum:
You cannot reply to topics in this forum
|
|