Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Datagrid user add item in bound collection

$
0
0
Is there a way to prevent the instantiation of a data grid row item until all the fields have been validated? Currently I create a data grid with predefined columns, BindingList<T>{ AllowNew = true } and then set the data source on the data grid equal to the binding list.

This requires a default ctor on T which of course leaves potential for uninitialized fields. Datagrid validation can prevent the erroneous commit but as T allows a new instance without initializing all its fields, properly implementing equality on T which I need in my case is burdened with all the null checks and resulting decisions etc.

Thanks!

Viewing all articles
Browse latest Browse all 2535

Trending Articles



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