I want to get list listview items in the static class. Because I want to pass this class variable to another class. So I have tried...
- public static class FileMngUserID
- {
- public static List<int> UserId;
- public static List<string> ImgName;
- }
-
- foreach (DocumentsUser item in listView1.SelectedItems)
- {
- FileMngUserID.UserId.Add(Convert.ToInt32(item.UserId));
- FileMngUserID.ImgName.Add(item.Parent_File_Name);
- }
but here
FileMngUserID.UserId.Add(Convert.ToInt32(item.UserId)); occurring error '
Object reference not set to an instance of an object.'