dotnet
There are 4 entries for the tag
dotnet
Good call to Marty in the comments of my last post, who basically hit the nail on the head. I had been content to leave it alone and just go about setting them in that order, but something he said struck me as odd. He said (regarding setting the DisplayMember) “ which it is by default, but you also explicitly declared it that as well”. And that got me thinking about documented expected behavior, and actuality.
His contention is that basically when you Set ValueMember if DisplayMember is empty then replace with value member. Minus some syntactic sugar and refactoring, he’s...
Discovered something interesting and annoying today…pardon me if you’ve already heard this one.
In C# 2.0 if you bind a List<BusinessObject> to a System.Windows.Forms.ComboBox you can set the ValueMember and the DisplayMember to set which properties of your business object will be the “value” and which will be the “display” text. Simple enough.
After playing around a bit, I “discovered” that if you set DisplayMember = “”; (empty string) then it will use the ToString() of the bound object. I say “discovered” because if I had looked on MSDN I would have seen that…but I didn’t, and I found out by accident,...
Continuing my efforts to educate my team on the new features of 2.0, here’s what I had to say about Partial Types. (Maybe I don’t “get” partial types…they seem more like they would be sources of confusion than actually useful…)
One of the first things you will likely notice, when you go to create a new form (win or web) is that the “code behind” is different. Incomplete. Or, put in the manner of the Talking Heads:
And you may find yourself, creating a new WinForm;
And you may find yourself, looking in the Code-Behind
And you may find definitions, in another part of...
As I mentioned previously I’m educating my team on the new 2005/2.0 stuff, and extending that here. This is not new information, but as they say on TV during the summer, “if you haven’t seen it, it’s new to you”. (and if it’s not new to you, and I get it totally wrong, please tell me. I’m still learning this stuff too.)
One of the new features of C# in 2.0 is what’s called “Generics”. What is a generic? Essentially it boils down to generalization in design.
Think about a collection of some object. In a structure such as a Linked List. Very...