c# - WPF DataGrid CanUserAddRows event -


is there event or command use can invoke object getting added observablecollection before gets added?

at moment, once user clicks row in grid, adds collection, need assign properties in c# don't want assign in grid.

public void event {   // want before canuseraddrow event collection.add(<t>;  } 

you can use datagrid.initializingnewitem event:

private void initializingnewitem(object sender, initializingnewitemeventargs e) {     //use e.newitem here } 

from msdn

you can set default values new item handling initializingnewitem event , setting values programmatically


Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -

collision detection - C++ library for mesh to mesh intersection: what is available? -