ComboBox Issue: Cannot bind to new value member

后端 未结 6 1742
甜味超标
甜味超标 2021-01-14 08:02

I\'v got a combobox that I created as a user control(it\'s actually made up of a label, combobox and textbox). I\'m trying to bind a dataset to the combobox datasource, but

6条回答
  •  青春惊慌失措
    2021-01-14 08:19

    Surely the fragment of code below is going to cause an issue?

    public string value
    {
        get { return _value ; }
        set { _value = value; }
    }
    

    You need to name this something else e.g. comboValue. "value" represents the implicit variable passed into a property declaration.

    i.e.

    public string comboValue
    {
        get { return _value ; }
        set { _value = value; }
    }
    

提交回复
热议问题