Validate the selected value in a WPF combobox

前端 未结 1 1966
-上瘾入骨i
-上瘾入骨i 2021-02-15 15:28

Like the title says, I am trying to validate my form, but I have an issue getting the combobox value:



        
1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-15 16:02

    Stupid, stupid stupid lack of observation on my part. If you were to change the ComboBox's Text to SelectedValue instead like so:

    
    

    One will get the selected value and NOT the text.

    For those of you who might want to read on it, I found the original tutorial here.

    WPF TextBox Validation with IDataErrorInfo

    0 讨论(0)
提交回复
热议问题