Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何删除 WPF 中添加的 GridView 项目边距?
谢谢!
它称为RowHeaderWidth不是项目的边距。所以,你要做的只是设置RowHeaderWidth="0"。
RowHeaderWidth
RowHeaderWidth="0"
您可以使用删除属性从 Gridview 中删除所选项目。 例如:
if(datagrid.SelectedIndex >= 0) { Student student = datagrid.SelectedItem as Student; col.Remove(student); }