How to add Controls to ListView Control in WPF
-
Can any one Help, I have tried add Controls to ListView Control in WPF Application.
private void Form_Load(object Sender, RoutedEventArgs e) { Button btn = new Button(); btn.Name = "Button1"; btn.Content = "Button Text"; listView1.Controls.Add(btn); //this.listView1.Controls.Add(new Button()); }
But I got the Error 'System.Windows.Controls.ListView' does not contain a definition for 'Controls' How to add Controls to ListView Control in WPF Thanks, Sivaprasad -
Can any one Help, I have tried add Controls to ListView Control in WPF Application.
private void Form_Load(object Sender, RoutedEventArgs e) { Button btn = new Button(); btn.Name = "Button1"; btn.Content = "Button Text"; listView1.Controls.Add(btn); //this.listView1.Controls.Add(new Button()); }
But I got the Error 'System.Windows.Controls.ListView' does not contain a definition for 'Controls' How to add Controls to ListView Control in WPF Thanks, SivaprasadUse
AddChild
instead.Deja View - the feeling that you've seen this post before.