Adding progressbar in listview/grid
-
Hi. I have a listview that im using its view property as grid. i want to have a grid with rows where each row has a textbox and a progressbar. Ive created a class that have two members: a string member ans a progressbar member. I've created a collection object and added new instances of my class and then assigned the listview ItemsSource property to that collection. but when displaying the listview in runtime i see instead of the progressbar the following text : "system.windows.controls.progressbar minimum:0 maximum:10000 value:0". I guess its because the itemTemplate of the listitem is text, but i dont know how to implement it. here is the code :
private void Window_Loaded(object sender, RoutedEventArgs e) { System.Windows.Controls.ProgressBar p = new System.Windows.Controls.ProgressBar(); p.Maximum = 10000; p.Width = 100; ObservableCollection<somesome> o = new ObservableCollection<somesome>(); o.Add(new somesome { text ="text" , pro = p }); listView1.ItemsSource = o; } public class somesome { public string text { get; set; } public System.Windows.Controls.ProgressBar pro { get; set; } }
Thanks for advance.