How can I define my own columns in a WPF DataGrid?

前端 未结 1 353
Happy的楠姐
Happy的楠姐 2021-01-12 04:04

I\'ve got an AutoGenerateColumns WPF-DataGrid getting bound in code-behind to LINQ-to-SQL, which works fine.

But when I take off the AutoGenerateC

1条回答
  •  北海茫月
    2021-01-12 04:41

    You're trying to put the column directly into the DataGrid (therefore it's trying to put the column in the grid's Items collection and that explains your error). You need to put it inside the Columns collection:

    
                
            
        
    
    

    0 讨论(0)
提交回复
热议问题