This is a migrated thread and some comments may be shown as answers.

RadComboBox that won't display values set directly in Database.

1 Answer 113 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Steve Lundy
Top achievements
Rank 1
Steve Lundy asked on 21 Apr 2010, 04:24 PM
I have an application where the end user has two ways of entering data.  The first method is though a form where the user can select various values from  ComboBoxes and/or enter values in text fields.  The second method involves a direct load into the database from an excel spreadsheet.

What I am discovering is that for one particular field, in this case a RadComboBox, if I create the record using the asp.net form and Telerik controls and then later go back and redisplay the record using the same form, everything works.  But if I load the data into the database directly, even though I have verified through SQL the data values for this field are correct, the value is never loaded into the ComboBox.  Instead the value reverts to the first item in my dropdown list.

I have verified though my Visual Studio debugger that the value is being read from the database and written into the appropriate memory location, but as soon as the page renders in the browser, the value is lost.  There is no custom Javascript code running on the client, which leads me to think the issue must be in the control itself.

What is even stranger is that I have other combo boxes on the same page that are able to display the select database values without a problem, regardless of how the values were set.

Does anyone have any clues or ideas would be greatly appreciated.

Regards,



Steve

1 Answer, 1 is accepted

Sort by
0
Accepted
Steve Lundy
Top achievements
Rank 1
answered on 21 Apr 2010, 08:30 PM
Ok, managed to resolve the issue myself.

The issue was the result of a second RadComboBox on the same form being left at a value of null on the page load process. This second RadComboBox was to be used as a filter on another RadComboBox, and was configured for AutoPostback.  Leaving this field NULL forced a PostBack to occur which wiped the value in my other RadComboBox.  Setting the value of the second combo box implicitly to a value from the selection list avoided the Postback from occuring.

This is what you get for trying to fix other people's code!!
Tags
ComboBox
Asked by
Steve Lundy
Top achievements
Rank 1
Answers by
Steve Lundy
Top achievements
Rank 1
Share this question
or