http://www.wpf123.com/news/?143.html


定义 combox绑定类:

public class ComboxData

{

public string Text{ set; get; }

public string Value{ set; get; }

public override string ToString()

{

return Text;

}

}

具体绑定:

DevExpress.XtraEditors.ComboBoxEdit combox;

ComboxData data = new ComboxData();

data.Text ="需要显示的文本";

data.Value= “类似Tag功能”;

combox.Properties.Items.Add(data);

由于我们重写了ToString()方法,这样绑定后就可以显示我们重写内容里面的文本

使用:

string text=(combox.SelectedItem as ComboxData).Text;

string value=(combox.SelectedItem as ComboxData).Value;


相关文章:

  • 2022-01-27
  • 2021-09-24
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
猜你喜欢
  • 2021-11-06
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2022-12-23
相关资源
相似解决方案