Autopopulate textbox when the dropdownlist column is selected in radgrid in place edit VB.Net

3 posts, 0 answers
  1. Supriya
    Supriya avatar
    5 posts
    Member since:
    Sep 2012

    Posted 11 Oct 2012 Link to this post


    I am using a insert/delete/update radgrid, I have a dropdown list and a textbox in the rad grid, when I select a value in the dropdownlist column, then the textbox should be autopoulated with the data from the database correspoding to the value selected in the dropdownlist. (VB.Net)

    For example I have menu table

    itemno        |      Description
      1              |      XXX
     2               |      YYYYY

    So the drop down list contains the itemno, so when the item no 2 is selected, then the Textbox should autopopulate 'YYYYY'

    Any help will be highly appreciated
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Oct 2012 Link to this post


    You can populate the textbox in SelectedIndexChanged event of the dropdownlist as shown below.
    Protected Sub ddl_SelectedIndexChanged(sender As Object, e As EventArgs)
        Dim ddl As DropDownList = DirectCast(sender, DropDownList)
        Dim item As GridEditableItem = DirectCast(ddl.NamingContainer, GridEditableItem)
        Dim txt As TextBox = DirectCast(item.FindControl("TextBox2"), TextBox)
        txt.Text = ddl.SelectedValue.ToString()
    End Sub

  3. DevCraft R3 2016 release webinar banner
  4. Hori
    Hori avatar
    6 posts
    Member since:
    Apr 2016

    Posted 26 May Link to this post

    what in asp, i've tried to convert it into c# it doesn't happen
Back to Top