We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Autocomplete Dropdown''s SelectedItem property

Hi All,
Can anybody please tell me why my syncfusion autocomplte comboboxe's(name is "cmbRelationship") SelectedItem property shows null inside the below mentioned method?

private void cmbRelationship_AutoCompleteControl_AutoCompleteItemSelected(object sender, Syncfusion.Windows.Forms.Tools.AutoCompleteItemEventArgs args)
{
try
{
boRetrieve = false;
if (firstTime)
{

if (cmbRelationship.AutoCompleteControl.SelectedItem != null)
LoadBODetails();
}
catch (Exception e2)
{
MessageBox.Show("Please Select Beneficial Owner","Message");
}
}

Thanks & Regards,
Subrata Das


1 Reply

AD Administrator Syncfusion Team March 4, 2009 06:33 AM UTC

Hi Subrata,

Thank you for using Syncfusion products.

AutoCompleteItemSelected event will raise after selecting an item from autocomplete popup. The SelectedItem property displays selected item from the list and not from the autocomplete popup. Hence SelectedItem displays null inside AutoCompleteItemSelected event. You can use SelectedValue property of AutoCompleteItemEventArgs argument to get the selected value in the autocomplete popup .

Here is the code snippet.

[C#]

void autoComplete1_AutoCompleteItemSelected(object sender, Syncfusion.Windows.Forms.Tools.AutoCompleteItemEventArgs args)
{
Console.WriteLine(args.SelectedValue.ToString());
}

Please let me know if this helps you.

Regards,
Jaya



Loader.
Live Chat Icon For mobile
Up arrow icon