Wanna bind an enum to a combo box?
Quite frequently in Web and Windows apps, I’ve found it necessary to display data values contained in an Enum type typically inside of a list or combobox type control.
Posted in Uncategorized, tagged .net, bind, combobox, data, datagridviewcomboboxcolumn, datatridview, grid, nested, winforms on 2009/11/16| Leave a Comment »
Ugh, grids. Seems like no matter what I want to do it ends up being more complicated than I’d like. Same goes for binding to nested properties…
My workmate Vijay is playing with WCF with a small project, and was asking me how to display a “nested” property of his business object in a DataGridView. I'll walk through an example here, changing the class names to protect the innocent.
via Binding to Nested Properties : Mad Props! – Matt Hamilton.
also DataGridView: How to ind Nested Objects.
And while I’m at it here’s a good overview of binding combo boxes to your grid. (Yes, I’m too lazy to make another post.) Exploring DataGridViewComboBoxColumn Databinding.
For proof that I’m cleaning out Firefox tabs, here’s a decent post about binding a grid to a binding source. BindingSource and BindingList Of T – DataBinding Made Simple! And an MSDN link that you’ve probably already found via Google.
Posted in Uncategorized, tagged binding, bindinglist, collection, dataset, sortablebindinglist, windows-forms, winforms on 2009/06/22| Leave a Comment »
This is the second project I’ve used this for, I think he’s on to something. Thanks Tim!
If you are databinding your custom objects in a Bindinglist of to a DataGridView you will notice that the users can’t sort the rows by clicking on the columnheaders… Unlike an unbound DataGridView, the SortCompare event is not raised. Here is a class that uses IComparer to implement a BindingList that supports Sorting…