Quantcast
Channel: WPF datagrid new row event
Viewing all articles
Browse latest Browse all 6

WPF datagrid new row event

$
0
0

Im afraid I don-t understand your code fully. I think I get the whole set isnew to false when you are loading up data from the database, so when Im filling up the observable collection at the app startup but what is model and what is viewmodel is a bit unclear (I am used to working with the model view presenter pattern not the mvvm so maybe thats the reason).

From what I understand the viewmodel is the backing code for the window? Or the Presenter? and it would have 2 properties isnew is true, ok and then when loading up data out of the database which I do in the repository you would set it to false... Ok not sure how the model would work out like is the model the single class object or is it the whole observable collection? 

Maybe the whole setting it to false when loading it from the database might work if I set it to true by default but Im afraid that once I set it to true I have to refill the observable collection to set it to false. So say I add 5 rows, once I hit commit and it does the insert into it doesnt refill the whole observable collection, that method isnt hit as the datagrid adds them automatically to the OC its binded to so when I update one of the 5 rows it will still try to do an insert because the isNew will still be true right?

Im guessing the model part of your message is supposed to set that straight but I just dont understand that part.

Thanks for your help


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>