C#WinForm使用DataBinding报错无法将值格式化为所需类型
使用的UI控件时Cognex的Visionpro图片显示控件,这是错误提示
绑定代码是这样的
这是实现INotifyPropertyChanged接口类
这是这个绑定的类型
我在想是不是只有UI放置界面控件属性中展现出来的属性才能绑定,这个是个接口所以不行?

绑定代码是这样的
cogRecordsDisplay1.DataBindings.Add("Subject", UIProperty.Instance, "RecordLift");这是实现INotifyPropertyChanged接口类
public class UIProperty : INotifyPropertyChanged
{
private static UIProperty set = new UIProperty();
public static UIProperty Instance
{
get
{
return UIProperty.set;
}
set
{
UIProperty.set = value;
}
}
ICogRecord _recordLift=null;
public ICogRecord RecordLift
{
get
{
return _recordLift;
}
set
{
_recordLift = value;
FireStrChanged();
}
}
//必须实现INotifyPropertyChanged接口的此事件
public event PropertyChangedEventHandler PropertyChanged;
public void FireStrChanged(string propertyName="")
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
这是这个绑定的类型

我在想是不是只有UI放置界面控件属性中展现出来的属性才能绑定,这个是个接口所以不行?
...全文
相关推荐
C#Winform课程设计:学生兴趣调查.rar.rar
C#Winform课程设计:学生兴趣调查.rar.rar
DataGridViewToTreeView.zip不错的C#WinForm实例源码适合研究学习技术
DataGridViewToTreeView.zip不错的C#WinForm实例源码适合研究学习技术DataGridViewToTreeView.zip不错的C#WinForm实例源码适合研究学习技术 1.适合学生做毕业设计参考模板。 2.适合程序员学习开发研究用 3.适合小公司做项目参考技术使用用
C# WinForm
C# WinForm实践开发教程电子书完整版 使用c#
c# winform编程 实例 入门
c# winform编程 实例 入门 个人写的,希望对初学者有帮助
c# 访淘宝星星评价
c# 用listview实现模仿网站星型评价模式


