I am a newbie .net programmer learning WPF for past one month. One thing I am confused from the start is how real time data driven applications are built. I started with a basic application where I required to bind data to a datagrid which would have some 10 columns approx. The common way of data binding I have seen in all the tutorials is they have a sample data with which they build a business object(two/three fields at the max). But when it comes to handling larger data objects do they write getter/setters for all of the 10/15 fields? For that I preferred binding DataGrid to DataTables directly which involved less code. But it seems this approach might miss several advantages like getting notified on source/collection change,etc. I am unaware of real time app building. Would be nice if I get guidance with this.
Share
I don’t have experience of more than 15-20 columns in a DataGrid, but for that I did create getters and setters for the properties.
Creating a code snippet which templates a property with INotifyChanged helps of course also. http://drwpf.com/blog/2007/11/17/my-wpf-code-snippets/
It can also depend on where you get your objects from. In one project I did, the entities came from Entity Framework, which did implement INotifyPropertyChanged on properties, so in that case I didn’t need to write wrapping properties. I could bind the entities properties directly to datagrid’s columns.