简体   繁体   中英

WPF Datagrid editable template column

I've a WPF datagrid which is editable and user can add rows. One of its column is a template column with image. Because datagrid is editable there's always an empty extra row where you can add stuff and save. but when you haven't started adding something to that row, there's no point of showing the image in that template column, is there a way to disable that?

If you set CanUserAddRows="false" then that row will no longer be visible; you could then take care of flipping this property manually behind the scenes.

Another approach would be to simply bind visibility of the image to a property representative of what you are trying to achieve. When your conditions are met the bool can turn true thus making the image visible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM