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

RadDropDownList Not Getting Selected Value from Data base

1 Answer 15 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Perry
Top achievements
Rank 1
Perry asked on 04 Dec 2015, 07:39 PM

I am new to the Telerik platform and am building an edit form in a RadGrid populated via data entity with code behind needDataSource.

In the EditFormSetting I call a UserControl Form which renders the edit form when you click the edit record link.  The edit form has 2 GradDropDownLists that are populated via data entity as well.  When the edit form opens all the data from the data base is pulled in and fills the text boxes with the correct data using ASP code shown below.

Text='<%# DataBinder.Eval(Container, "DataItem.LastName2") %>'
 

The problem is the 2 DropDowns do not show the selected values from the database, the selected value shows the first item in the database table for the DropDown list.

How can I get these 2 DropDowns to display the database values ?

 

Thanks for any help

Perry

1 Answer, 1 is accepted

Sort by
0
Perry
Top achievements
Rank 1
answered on 07 Dec 2015, 01:55 PM

I figured this out the fix was very simple.  Since the edit form is part of the RadGrid I just had to reference the cell within the Grid like this: 

Text='<%# DataBinder.Eval(Container, "DataItem.DOB") %>'

Tags
Grid
Asked by
Perry
Top achievements
Rank 1
Answers by
Perry
Top achievements
Rank 1
Share this question
or