Silverlight datagrid 绑定嵌套对象属性
我对 Sivlerlight 世界完全陌生,所以我需要知道一件简单的事情。
如何将嵌套对象作为项目源绑定到 DataGrid。
我有一个 Employee 类,它看起来像:
Public class Employee
{
public long EmployeeId
{
get
{
return this._employeeId;
}
set
{
this._employeeId = value;
}
}
public string EmployeeName
{
get
{
return this._employeeName;
}
set
{
this._employeeName = value;
}
}
public tblDepartment tblDepartment
{
get
{
return this._tblDepartment;
}
set
{
this._tblDepartment = value;
}
}
}
现在类“tblDepartment”将部门名称作为其属性之一,所以我想要实现的是在 Silverlight 的 DataGrid 中显示 EmployeeId、EmployeeName 和部门名称。我正在使用 SilverLight 4.0。
问题是我无法找到如何绑定嵌套对象属性(即对象与对象中)。
任何人都可以帮我这里,
提前谢谢。
I am totally new to Sivlerlight world, so I need to know a simple thing.
how do I bind nested object as Item Source to the DataGrid.
I have a class Employee which looks Like :
Public class Employee
{
public long EmployeeId
{
get
{
return this._employeeId;
}
set
{
this._employeeId = value;
}
}
public string EmployeeName
{
get
{
return this._employeeName;
}
set
{
this._employeeName = value;
}
}
public tblDepartment tblDepartment
{
get
{
return this._tblDepartment;
}
set
{
this._tblDepartment = value;
}
}
}
now the class "tblDepartment" has Department name as its one of the properties, so what I want to achieve is show EmployeeId, EmployeeName and Department name in the DataGrid of Silverlight. I am using SilverLight 4.0.
Issue is I am not able to find how to bind Nested objects properties(i.e. Objects with in Objects).
can anyone help me out here,
thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你应该能够做到
You should be able to do