VB.NET - SfComboBox sfComboBox1.SelectedValue is displaying null values when default value is set.

Hi,

Have created a form with SfComboBox with multi-columns, DataTable as DataSource, and by default shows one of the list value.

cboCurr.SelectedValue is displaying null values when the default value is set. It displays proper SelectedValue only when the user selects values from the dropdown.

================================================

Try

            sql = "SELECT Currency.ID, [Code] + ' - ' + [Country] AS Curr, Currency.Code, Currency.Numeric, Currency.Decimal FROM [Currency]"

            Dim tbl As New DataTable()

            If con.State = ConnectionState.Closed Then con.Open()

            cboCurr.DataSource = Nothing

            da = New OleDb.OleDbDataAdapter(sql, con)

            da.Fill(tbl)

            cboCurr.ValueMember = "ID"

            cboCurr.DisplayMember = "Curr"

            cboCurr.DataSource = tbl

            cboCurr.Text = "INR - INDIA"

            cboCurr.DropDownListView.ItemHeight = 23

        Catch ex As Exception

            ShowMsg(ex.Message, "Oh snap!", MsgType.Critical, MsgButton.OkOnly)

        Finally

            con.Close()

        End Try

===================================================

Without selection from dropdown......

Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click

MsgBox(cboCurr.SelectedValue)

End Sub

=====================================================

Selection from Dropdown

    Private Sub cboCurr_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCurr.SelectedIndexChanged

        MsgBox(cboCurr.SelectedValue)

    End Sub



8 Replies 1 reply marked as answer

EM Elakkiya Muthukumarasamy Syncfusion Team March 15, 2021 12:25 PM UTC

Hi RAAHUL,  
   
Greetings from Syncfusion.  
   
We were able to observe the reported behavior " SfComboBox SelectedValue is displaying null values when set the default value" and we too able to reproduce it. We have logged a report on this and the patch for this fix is estimated to be available on 5th   April 2021.   
   
You can track the status of this defect using following feedback link:   
   
   
Please let us know if you need any other assistance on this.   
   
Regards,   
Elakkiya 



VR Vijayalakshmi Roopkumar Syncfusion Team April 6, 2021 02:56 AM UTC

Hi Raahul,    
Thanks for your patience.  
The reported issue with RibbonSfComboBox SelectedValue is displaying null values when set the default value has been fixed and included in the patch which can be download from the below links.  
Recommended approach - exe will perform automatic configuration.   
Please find the patch setup from below location:  
  
Please find the patch assemblies alone from below location:   
  
  
Assembly Version: 19.1.0.54 
   
Installation Directions:   
This patch should replace the files "Syncfusion.SfListView.Winforms” under the following folder.   
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\[TargetFramework]   
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\19.1.0.54\precompiledassemblies\19.1.0.54\4.6   
   
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you must manually copy and paste them to the preferred location or you must run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.   
   
 
   
Disclaimer:   
Please note that we have created this patch for version 19.1.0.54 specifically to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.  Please let us know, if you are using any other Syncfusion version, we will provide patch in your version.   
   
Regards,   
Vijayalakshmi VR  
 



RA RAAHUL April 6, 2021 12:49 PM UTC

Hi Vijayalakshmi,

I getting System.NullReferenceException when dropdownstyle is set to dropdownlist. Let me know how to revert patches asap. since I am not able to proceed with my other development.

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=Syncfusion.SfListView.WinForms
  StackTrace:
   at Syncfusion.WinForms.ListView.SfComboBox.OnSelectedItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
   at System.Collections.ObjectModel.Collection`1.Clear()
   at Syncfusion.WinForms.ListView.SfComboBox.set_Text(String value)
   at Invoice_Managment.frmEmpAdd.InitializeComponent() in Forms\frmEmpAdd.Designer.vb:line 159



VR Vijayalakshmi Roopkumar Syncfusion Team April 7, 2021 03:48 PM UTC

Hi Raahul 
 
Thank you for your update. 
 
We have checked the reported behavior with SfComboBox using our last updated patch and found that NRE crash does not occured on clicking the sfcombobox button, but we could able to reproduce the crash on selecting the item from SfComboBox with both DropDownStyle such as DropDownList and DropDown. So we are currently analyzing on this behavior and confirm you the validation details by 9th April,2021. 
  
Video:  
  
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 



VR Vijayalakshmi Roopkumar Syncfusion Team April 9, 2021 11:57 AM UTC

Hi Rahul   
   
Thanks for your patience.  
  
The reported issue with SfComboBox has been fixed and included in the patch which can be download from the below links.  
   
Recommended approach - exe will perform automatic configuration.   
   
Please find the patch setup from below location:   
   
Patch link :   
Please find the patch assemblies alone from below location:   
   
Assemblies Link:   
  
Nuget link:    
  
  
Assembly Version: 19.1.0.54 
   
Installation Directions:   
This patch should replace the files "Syncfusion.SfListView.Winforms” under the following folder.   
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\[TargetFramework]   
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\19.1.0.54\precompiledassemblies\19.1.0.54\4.6   
   
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you must manually copy and paste them to the preferred location or you must run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.   
   
   
Disclaimer:   
Please note that we have created this patch for version 19.1.0.54 specifically to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.  Please let us know, if you are using any other Syncfusion version, we will provide patch in your version.   
   
Regards,   
Vijayalakshmi VR 
 
 



PA Pavel May 5, 2021 10:20 AM UTC

Hi, how can i get this patch? I have same problem with selectedValue at .Net Framework 4.0 and 19.1.0.59 sfcombobox. 
And one more problem. With the following settings
DropDownStyle = DropDown

If you select an item from the list and try to change the text, the following error is fired
"cannot change observablecollection during a collectionchanged event"

Binding is simple:
            Dim usStates As New List(Of String)()
            usStates.Add("Alaska")
            usStates.Add("Arizona")
            usStates.Add("Arkansas")
            usStates.Add("California")
            usStates.Add("Colorado")
            usStates.Add("Connecticut")
            usStates.Add("Delaware")
            usStates.Add("Florida")
            usStates.Add("Georgia")
            sfComboBox1.DataSource = usStates

if I return to the previous version 19.1.0.58 then everything works without errors.



EM Elakkiya Muthukumarasamy Syncfusion Team May 6, 2021 04:06 PM UTC

Hi Raahul, 

Thanks for your update. 

Issue1: SfComboBox SelectedValue is displaying null values when set the default value 

Due to some internal issues, we could not include this fix in 19.1.0.59 version(last week nuget release). So it will be included in our upcoming 2021 Volume 1 SP1 release it will be expected to be published on Mid of May 2021.We will intimate you once it’s get published. We appreciate your patience until then. 


Issue2:Exception thrown f you select an item from the list and try to change the text. 

The reported issue is a know issue at our end. We will be included this fix in our upcoming 2021 Volume 1 SP1 release it will be expected to be published on Mid of May 2021.We will intimate you once it’s get published. We appreciate your patience until then. 


Regards, 
Elakkiya 



VR Vijayalakshmi Roopkumar Syncfusion Team May 13, 2021 12:45 PM UTC

Hi Rahul  
  
We are glad to announce that our Essential Studio 2021 Volume 1 Service pack v19.1.0.63 is rolled out with fix related with SfComboBox and is available for download under the following link. 
  
  
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
  
Regards, 
Vijayalakshmi VR 


Marked as answer
Loader.
Up arrow icon