Forum

[C#] DataGridView a...
 
Notifications
Clear all

[C#] DataGridView and List, how to change displayed name in class item?

2 Posty
1 Users
0 Reactions
2,058 Widok
0
Topic starter

from example code

var bindingList = new BindingList(this.dokumenty);
var source = new BindingSource(bindingList, null);
dataGridView1.DataSource = source;
2 Answers
0
Topic starter

for display name change

1
2
3
4
5
6
7
8
9
10
       [System.ComponentModel.DisplayName("My New Name")]
                private stringm my_field
        public string My_field{
            get {
                return my_field;
            }
            set {
                my_field= value;
            }
        }
	   [System.ComponentModel.DisplayName("My New Name")]
                private stringm my_field
		public string My_field{
			get {
				return my_field;
			}
			set {
				my_field= value;
			}
		}
0
Topic starter

hide from list

hide from list

1
2
3
4
5
6
7
8
9
10
        [System.ComponentModel.Browsable(false)]
        private stringm my_field
        public string My_field{
            get {
                return my_field;
            }
            set {
                my_field= value;
            }
        }
		[System.ComponentModel.Browsable(false)]
		private stringm my_field
		public string My_field{
			get {
				return my_field;
			}
			set {
				my_field= value;
			}
		}

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: