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

DataGridView guidance

$
0
0
I am working with a form which uses a BindingList<T> and a ListBox to display items that are added/removed. The request is to maintain a sorted collection and allow editing of existing items post creation/data entry from the display control. I am thinking to implement a DataGridView against a SortedList collection, this form has its own distinct persistence implementation and so it is not database backed (a save routine is invoked by the user which accesses the collection).

That should allow me one consistent interface to add new or modify existing items. I am happy to research the details but was hoping to get guidance on the approach so the implementation is most optimal. The existing ListBox has its DataSource property set to the instance of the BindingList<T> collection instantiated at form load time. I am not clear if that is sufficient or even a possible approach when migrating from a ListBox to a DataGridView and swapping out the BindingList<T> for a variation on a SortedList collection?

The current form uses TextBox controls with native validation for data entry, I see DataGridView supports the same model which is convenient.

How do updates communicate between the collection and items within the collection with a DataGridView? Is their a better way to associate a DataGridView to SortedList collection than what was done with the ListBox and BindingList<T>?

Any opinions or suggestions would be greatly appreciated.

Viewing all articles
Browse latest Browse all 2535

Trending Articles



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