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

Combo box returning Null when DataValueField is set.

<asp:SqlDataSource ID="rejectReason" runat="server" ConnectionString="<%$ ConnectionStrings:qcData %>" SelectCommand="SELECT [id],[rejectCode] FROM [rejectionReasons]"></asp:SqlDataSource>

<ej:ComboBox runat="server" ID="NCRreason" CssClass="cbox" DataSourceID="rejectReason" DataSourceCachingMode="Session" DataTextField="rejectCode" DataValueField="id" AllowCustom="false" Placeholder="Select reason" AutoFill="True"></ej:ComboBox>

NCRreason.value in code behind is null.  If I remove the DataValueField the .value will be populated with the text.  I need the id associated with the text for my database.

1 Reply

SS Sivakumar ShunmugaSundaram Syncfusion Team December 27, 2022 11:28 AM UTC

Hi Chris,

Greetings from Syncfusion support.

We have been able to replicate the issue you have reported on our end. However, we would like to inform you that our current focus is on the development of EJ2 and Blazor components, and we have not made any improvements to the EJ1 components.

With that being said, we recommend considering the use of the EJ2 ComboBox component to see if it resolves the issue you are experiencing. We have included a link to the EJ2 ComboBox demo and documentation for your reference. The EJ2 ComboBox has many features and capabilities, and it is compatible with the EJ1 components. We have also included a link to our compatibility documentation for your reference.

Compatibility documentation: https://help.syncfusion.com/js/compatibility-ej1-ej2

EJ2 Demo: https://ej2.syncfusion.com/javascript/demos/#/bootstrap5/combo-box/default.html

EJ2 Documentation: https://ej2.syncfusion.com/javascript/documentation/combo-box/es5-getting-started/

Confirm whether using the EJ2 ComboBox component will resolve the issue on your end. We will continue to investigate the reported issue based on your confirmation.

Live Chat Icon For mobile
Up arrow icon