The winforms DataGridView
has a virtual model and uses the OnCellValueNeeded
method to gets cell values from a a user defined data store.
How do i do this in wpf? The DataGrid
doesn't seems to have a OnCellValueNeeded
method.
Thanks
The winforms DataGridView
has a virtual model and uses the OnCellValueNeeded
method to gets cell values from a a user defined data store.
How do i do this in wpf? The DataGrid
doesn't seems to have a OnCellValueNeeded
method.
Thanks
Not sure if this already helps you:
DataGrid uses UI virtualization, what means that objects are not created before they are visible on screen and the corresponding properties of your source objects will not be called as long as they are not visible. It means also that ui-elements are recycled after they are no more visible.
This is for free and you don't have to do additional coding to use this feature. If I interprete your question right, the main question is, how to know that a property of a business-object is needed. For UI-virtualization, this is when the property is called the first time - You can do some lazy initialization. But beware to put too heavy initialization code into the properties (DB synchronous lookups etc), otherwise your DataGrid will become very slow and unhandy.