Binding Rad Drop Down List in RadGrid

3 posts, 0 answers
  1. Silviu
    Silviu avatar
    44 posts
    Member since:
    Feb 2015

    Posted 27 Mar 2015 Link to this post

    I have a RadGrid with an update function and an EditItemTemplate.
    In here I have a RadDropDownList which is populated by a SQLDataSource.

    My issue is: when a user clicks Edit on a row and the dropdown is displayed, how do I have the dropdown select the row's value from the list?

    Similar to how the textbox is populated with:

    Text='<%# Bind( "Notes") %>

    What is the equivalent for dropdown?
    My dropdown:
    <telerik:RadDropDownList ID="rddlLocations" runat="server" DataSourceID="GetLocationsSqlDataSource" DataTextField="Location" DataValueField="ID"></telerik:RadDropDownList>

  2. Silviu
    Silviu avatar
    44 posts
    Member since:
    Feb 2015

    Posted 30 Mar 2015 in reply to Silviu Link to this post

    No one?
  3. DevCraft R3 2016 release webinar banner
  4. Hristo Valyavicharski
    Hristo Valyavicharski avatar
    975 posts

    Posted 01 Apr 2015 Link to this post

    Hi Silviu,

    Set the SelectedValue property:

    <telerik:RadDropDownList ID="rddlLocations" runat="server" DataSourceID="GetLocationsSqlDataSource"  SelectedValue='<%# Bind("ID") %>'  DataTextField="Location" DataValueField="ID"></telerik:RadDropDownList>

    I hope this helps.

    Hristo Valyavicharski

    See What's Next in App Development. Register for TelerikNEXT.

Back to Top