Abhilash J A

Abhilash J A

  • NA
  • 2.4k
  • 583.7k

need advice - binding listview with poppup window in wpf c#.

Dec 26 2016 11:00 AM
Hello everyone,
 
I have Listview with checkboxes.
 
 
After loaded listview, and check checkbox item then click on above button and want show a another window.xaml page like popup. 
 
 
 
 
 
 
After showing this poppup, then fill textbox again click on 'Save' button. Then I want to the remove listview checked items. How can I do this programmatically? I have tried...
 
Inside 1st class, I have get checked item's id and documentname (these are the stored procedure parameters) 
  1.  private void Img_ArchiveSe_MouseLeftButtonDown1(object sender, MouseButtonEventArgs e)  
  2.         {  
  3.             foreach (DocumentsUser item in listView1.SelectedItems)  
  4.             {  
  5.                 UserIdArc.Add(item.UserId.ToString());  
  6.                 ImgNameArc.Add(item.Parent_File_Name);                       
  7.             }  
  8.             AddArchiveNamexaml SP = new AddArchiveNamexaml();  
  9.             SP.ShowDialog();  
  10. }  
  11.   
  12. public static ObservableCollection<string> ImgNameArc = new ObservableCollection<string>();  
  13.         public static ObservableCollection<string> UserIdArc = new ObservableCollection<string>();  
 
 Then, 2nd class (ie; code behind of popup window.xaml) insted Save button click event, I have get list of items (List data = service.GetUserDocumentsArc(objUserIdArc, objImgNameArc); ) and want to bind listview from 1st class.
  1.   private void btnAddUser_Click(object sender, RoutedEventArgs e)  
  2.         {  
  3.             DMSBusinessLayer service = new DMSBusinessLayer();  
  4.             string objImgNameArc = string.Join(",", UC_FileMgmt.ImgNameArc.ToArray());  
  5.             string objUserIdArc = string.Join(",", UC_FileMgmt.UserIdArc.ToArray());  
  6.             List data = service.GetUserDocumentsArc(objUserIdArc, objImgNameArc);  
  7. }  
 I have done, is this correct or not ? Please advice me.
 
 

Answers (1)