【发布时间】:2020-12-08 20:57:42
【问题描述】:
我有一个 xml 文件,他们有一个属性“Active = true”。如果我删除客户,它将“活动”设置为 false,但客户仍应在我的 xml 文件中。我只是想隐藏“活动”行为假的 DataGrid 列。所以每个“active = false”的客户都不应该显示在我的数据网格中。我希望你明白我想做什么:P
我想过这样的事情:
private void HideCustomer()
{
if (active == false)
{
DataGrid.HideRow ???? // So if the customer has this attribute set to "false" the row
} // should be hidden in the DataGrid
}
【问题讨论】:
-
“我有一个 xml 文件”。您是在使用 xmldataprovider 还是将数据转换为对象?
-
我有文本框,例如,我可以在其中输入姓名和姓氏,当我按下保存键时,我使用 xmlserializer 编写 xml 文件。我的 datagrid itemssource 是我的客户列表。我希望这就是您想要的。