We're using the XamDataGrid with 'LoadOnDemand'. We have a couple of custom ICondition classes that check to see whether a record has errors or not. For example, we have a RecordHasErrorsCondition that checks to see if either the parent record or, optionally, any of it's child records currently has an error. However, when child records exist, this condition can take a long time to execute the first time, if none of the child records have been previously loaded. However, the only way, any of the records could have an error is if the user has loaded and edited them, so what we'd like to do is skip records that have yet to be loaded or initialized. I see that the record's DataPresenter has an IsLoaded and IsInitiliazed property, but every time I check these properties, they're true [probably because I'm iterating the records which causes them to be loaded and initialized]. Anyway, is there a way for me to programatically check whether a record has been loaded previously, or maybe from the parent level, determine if it's child records have ever been expanded or loaded? If it has been, we'll check for errors, otherwise, we'll skip the child record(s)...
Still looking for answer to this issue. I've reviewed several links for XamDataGrid performance optimization and I've been tirelessly running my VS debugger trying to find an exposed property that might tell me when a record has yet to be initialized. There has to be a way to know when records have been previously loaded or not. Does anyone have an answer for this?
Since my data source item is a DataRowView, I'm able to just check the data source for errors instead for now, but it would still be nice to know if there's a way to determine if a row has been previouslyy loaded. 1) It would speed my filter up to not bother with rows that haven't been previously loaded. 2) I may, at some point in the future, need to do this for a data source item that does not store its own error information.
Hello,
I reviewed your requirements but for performance optimizations the XamDataGrid uses Lazy Object Creation when is set “LoadOnDemand”. The DataRecord and the Cell objects are thin wrappers around records and field values that are only created when they are asked for. However the DataRecord has Loaded and Unloaded events that you can use to make the validation. Also you can make the validation of the cell or even of the whole record at the moment end user change its value. For more information about this approach you can look at this references:
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamDataPresenter_Validate_Data_as_Your_End_Users_Edit_a_Cell.html
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamDataPresenter_Validating_Edited_Cell_Data_in_xamDataPresenter.html
If you need any further assistance on the matter please let me know.