【问题标题】:Combobox Binding To Value组合框绑定到值
【发布时间】:2010-11-24 23:24:31
【问题描述】:
    [Display(Name = "Type of Delivery:",
        Description = "(TBC)")]
    public string DeliveryType
    {
        get { return _deliveryType; }
        set
        {
            Validator.ValidateProperty(value,
                                       new ValidationContext(this, null, null)
                                           {MemberName = CalculatorParameters.GetPropertyName()});
            _deliveryType = value;
        }
    }





    <ComboBox ItemsSource="{Binding ElementName=v_DeliveriesOrderedDomainDataSource, Path=Data}"  SelectedItem="{Binding DeliveryType, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" DisplayMemberPath="Description" Margin="12,12"/>

这很好用,除了绑定的值是我的对象 v_DeliveriesOrdered 的 ToString(),但我想使用特定字段 即:值是“V_DeliveriesOrdered : {US,U.S.A. Port of Entry}”而我想使用值只是美国的字段代码

我该怎么办? (而不是取 '{' 和 ',' 之间的任何东西

【问题讨论】:

  • “使用特定值”你的意思是作为显示值吗?
  • 是的,类似的

标签: silverlight data-binding combobox


【解决方案1】:

所以我用常规的 Silverlight WCF 服务替换了 DomainServices,问题就消失了

【讨论】:

    猜你喜欢
    • 2016-09-09
    • 1970-01-01
    • 1970-01-01
    • 2015-05-24
    • 1970-01-01
    • 2018-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多