WPF Repeater (like) control for collection source?

前端 未结 1 591
北恋
北恋 2020-12-08 10:18

I have a WPF DataGrid bound to ObservableCollection. Each item in my collection has Property which is a List. In m

1条回答
  •  半阙折子戏
    2020-12-08 10:42

    What you did by specifying inside of ItemsControl is you added this instance of DataTemplate to default property of ItemsControl which is Items. So the exception you got is the expected result: first you specify the ItemsSource, then you modify Items. Instead you should modify ItemTemplate property on your ItemsControl like so:

    
        
            
                
            
        
        
            
                
            
        
    
    

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