DisplayMemberPath concatenation

前端 未结 3 2020
孤城傲影
孤城傲影 2021-02-07 02:03

I am trying to bind two values to a ComboBox display value, but I do not know how to do.

This way does not work:

cboRegion.DisplayMemberPath = \"idregion         


        
3条回答
  •  自闭症患者
    2021-02-07 02:35

    You could create a view, concatenate the two fields, and then refer to the concatenated field name in your DisplayMemberPath property in c#, after referring to the new view in your itemssource property (and after updating your entity framework model)

提交回复
热议问题