SelectedValue which is invalid because it does not exist in the list of items

前端 未结 9 1724
孤独总比滥情好
孤独总比滥情好 2021-02-03 21:16

I encounter this problem repeatedly, and haven\'t a clue what is causing it. I get an exception in the DataBind: SelectedValue which is invalid because it does not exist i

9条回答
  •  逝去的感伤
    2021-02-03 21:46

    @PMarques answer helped me out and did solve my problem.

    However whilst experimenting, it clicked in my head why I was gettign the error in the first place.

    I was setting the "Text" attribute thinking that it might create an encompassing label or fieldset + legend, for me (which it doesn't).

    The Text property for a list is infact the SelectedValue property for a ListControl.

    So my mistake in misinterpreting what the text property did.

提交回复
热议问题