Question Added property don't update data source

bondra

Well-known member
Joined
Oct 24, 2020
Messages
77
Programming Experience
Beginner
I've added an propery in a class which I now trying to reach from my Data Grid View. It doesn't show up however. I've tried to add new Data Sources, removed the DataGridView and added a new one but that doesn't seem to do anything.

Any ideas?
 
Did you declare the property as public? If not, it won't be automatically be bound to by the data grid view.
 
Yes it's declared as public
C#:
        public string AnimalType
        {
            get { return this.GetType().Name; }
            set { }
        }
 
Asp.Net Web Forms has a GridView control, Windows Forms has a DataGridView control.
Thread posted in Asp.Net Web Forms forum, talking about DataGridView. Which is it?
 
Moved thread to Windows Forms
 
Can you show us how you are binding to the DataGridView? Did you accidentally set the autogenerate columns to false?
 
Back
Top Bottom