Hi every one !

i am try to Bind Dropdownlist from Gridview .... what i am trying to do i fill my GridView from dataBase .. when i select a Row From Grid it Fill TextBoxes But show error in

"'cmbNature' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value"

I am using the follwing code:

Protected Sub Repeater1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Repeater1.SelectedIndexChanged
        txtSNo.Text = Repeater1.SelectedRow.Cells(1).Text
        txtNameTitle.Text = Repeater1.SelectedRow.Cells(2).Text
        cmbNature.SelectedValue = Repeater1.SelectedRow.Cells(3).Text
        cmbForum.SelectedValue = Repeater1.SelectedRow.Cells(4).ToString
        txtDate.Text = Repeater1.SelectedRow.Cells(5).Text
        txtProceedings.Text = Repeater1.SelectedRow.Cells(6).Text
        txtDesc.Text = Repeater1.SelectedRow.Cells(7).Text
    End Sub

Thanks in Advance

5 Years
Discussion Span
Last Post by |-|x

Where is the dropdown getting its list from? if it is databound, you may need to force the databinding to take place first on the postback (ie: before the above event)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.