Posts Tagged ‘winforms’

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.

via Using Enums in List Controls – Rick Strahl’s Web Log.


Read Full Post »

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.

Read Full Post »

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…


Read Full Post »