Robert McLaws: FunWithCoding.NET

Public Shared Function BrainDump(ByVal dotNet As String) As [Value]

News

<script type="text/javascript"><!-- google_ad_client = "pub-4330602465258980"; google_hints = "ASP.NET, VB.NET, C#, C#.NET, WindowsForms, .NET Framework, VS2005, Visual Studio, XAML, WinFX, Windows Workflow, WPF, WCF, Atlas, NetFX3, Visual Studio Orcas"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel ="4997399242"; google_color_border = "B6C9E7"; google_color_bg = "EFEFEF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "002C99"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<!--
-->

You should feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever. That said, I will most likely only delete abusive, profane, rude, or annonymous comments, so keep it polite, please.

Blogroll

Cool .NET Articles

My .NET Tools

My Builder.com Articles

My MSKB Articles

WinForms 2.0: Still the Bastard Child of .NET Development

You know, there are some great new WinForms controls in .NET 2.0. It's obvious that Microsoft has spent a lot of time making WinForms better than it was in 1.X. But having spent the last several days building WinForms 2.0 demos, I'm extremely frustrated at the holes that are still all over the place. Maybe I'm just dumb and don't know what I'm doing, or maybe I really do need a college degree to do this stuff, but some things that are supposed to be intuitive are anything but. Just a few of my frustrations (please jump in if you know the answers to any of these):

  • MenuStrips and ToolStrips are cool, but for the life of me, I can't figure out how to assign an ImageList to a ToolStrip to be able to set the ImageIndex property
  • You can't DataBind to a TreeView or ListView control
  • You can't get a TreeNode by name or text
  • You can't use an XML file as a DataSource without infering a schema and converting that to a DataSet
  • You can't create a new SplitterPanel in memory and substitute it for another at runtime with the SplitContainer control
  • You can't layout several bits of information in a ListView control (to have an Outlook-like mail items UI) without some serious OwnerDraw overriding

WinForms 2.0 is still severely lacking on discoverability. Why is it that the same controls in WebForms are far more advanced than the ones in WinForms? I mean, come on... I can't databind an XML file to a TreeView? Am I the first one to ever try that scenario? I highly doubt it. I shouldn't have to get an Infragistics control to DataBind a frickin TreeView. Seriously.

Don't get me wrong, many of the other changes are awesome. I know you guys have worked hard. But I thought I was building a "rich experience" on the desktop. I can't do that when the web version has more of the basics nailed than the Windows version does.

If WinForms development at Microsoft is being forsaken to flesh out Avalon, I'm gonna be severely pissed if some of these basics are missing when Orcas comes out.

Bottom Line: The built-in WebForms controls are head and shoulders above their WinForms brethren.

</rant>

Comments

jayson knight said:

I too have been baffled by the whole "databinding to XML" thing for a while now; writing to an .xsd and then running xsd.exe, then adding the class to the project seems like a total PITA. Seems like that could all be done behind the scenes. Here's to asp.net :-).
# June 25, 2005 2:36 AM

David said:

I agree, the data binding story in WinForms is terribly. Another one that doesn't work: CheckedListbox. Essentially this half baked support made me not use data binding in the first place, because there were too many controls where I would have to write custom data binding code myself. I had a look at Avalon last week and have to say that the data binding story there is just beautiful, the most powerful and complete thing I have ever seen in that space.
# June 25, 2005 3:44 AM

Frans Bouma said:

I've yet to dig into databinding for .NET 2.0 more, but what I've seen so far isn't that bad, except the VERY CRAPPY decision to use 2 different ways to bind object graphs to controls: one for webforms and one for winforms. Oh, and one under the hood for datasets but no-one is allowed to know about that.

Databinding to a treeview... I never saw that as a problem though. It's not as straightforward as you might think, and often you want your own scheme how the tree is build up, given an object graph.

What I do hate about the .NET 1.x treeview is the crappy single-select option and the lack of finding a node back.

But these things are minor. Most development time in a large winforms application's GUI work is lost with dealing with databinding related crap, like change events are fired -> grids are updated, though the change event was about a removed object, -> grid crashes, which means you'd better use a special ArrayList, with IBindingList implemented, otherwise you're in for a lot of fun...
# June 25, 2005 5:33 AM

Robert McLaws said:

Thanks for the help Frans. I'll keep an eye out for that.
# June 27, 2005 5:43 PM

Mabsterama said:

Robert McLaws listed some of his peeves about WinForms 2.0 . A lot of them I agree with, including the

# August 28, 2006 5:25 AM