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

How can I get the DropDown List value from the Database

1 Answer 249 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Perry
Top achievements
Rank 1
Perry asked on 29 Jun 2018, 10:55 AM

I have a problem That I need help with.  I have a simple grid using all GridBoundColumns, except for 2 dropdown lists.

AllowAutoInsert and Updates are enabled so I do not do any code to show the value when I do an update.  All of my fields that are using a GridBoundColumn show the proper values from the database.  Except for  the 2 drop downs.  Both of DropDowns show no value at all.

Note the dropdowns do work and I can select a value, but the data from the database is not shown.  Can anyone please tell me how or provide a link that shows how I can get these values to populate the drop downs?

 

I have attached a screen shot that shows the form in edit mode

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 04 Jul 2018, 07:33 AM
Hi Perry,

I tested the described scenario with  the following demo (just changing the RenderMode="Classic") and the DropDownList is properly bound at my end. You can examine its markup in the source code of the demo and see whether it differs your actual configuration:
https://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx

Namely:
<asp:DropDownList ID="ddlTOC" runat="server" SelectedValue='<%# Bind("TitleOfCourtesy") %>'
    DataSource='<%# (new string[] { "Dr.", "Mr.", "Mrs.", "Ms." }) %>' TabIndex="7"
    AppendDataBoundItems="True">
    <asp:ListItem Selected="True" Text="Select" Value="">
    </asp:ListItem>
</asp:DropDownList>


Regards,
Vessy
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Perry
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or