Thanks for your advice! I found inheriting from CollectionBase was too bothersome, so I discovered another way: Inheriting from BindingList, which is a bindable generic list -- bingo! Now I can use the visual designer to connect properties of my customly defined item classes to the columns of my DataGridView. Hooray!
DerGuteMoritz
@DerGuteMoritz
Best posts made by DerGuteMoritz
Latest posts made by DerGuteMoritz
-
RE: .NET 2.0: DataGridView and DataSource0
-
.NET 2.0: DataGridView and DataSource
Hello everyone,
I'm new to .NET and decided to give it a try for a small, non-critical app. Basically, it's a configuration dialog with several text fields which are hooked to a simple storage object via .NET's neat DataBinding mechanism like that:
exampleTextBox.DataBindings.Add("Text", Config, "exampleProperty");
The Config object is finally serialized to an XML file using the nifty XmlSerializer. Pretty cool stuff so far!
Now I also need a DataGridView with two columns and a variable amount of rows (well, what else would you need DataGridView for, anyway). Obviously, hooking a DataGridView to a storage object isn't as trivial as it is with a text box. I realize there is a DataSource property which is supposed to be used for that matter, but still, I couldn't find a way to set it to e. g. an ArrayList containing structs with simple string members corresponding to the DataGridView's columns -- which is, of course, nothing to be surprised at: Why should the DataGridView know what kind of model I use to store its data?
Since I noticed many .NET people are reading these forums, I was hoping someone could shed some light on this issue for me!0 -
RE: Last.fm (formerly known as Audioscrobbler) TDWTF group
@R.Flowers said:
On an unrelated note, you may notice that, collectively speaking, the group seems to listen to a lot of Glenn Miller...
We'll see exactly when we've got 15 members :) Keep 'em coming!
-
RE: Why Java blows PHP out of the water!
@cwolves said:
Database calls are slow (at least compared to array cell calls).
Well, obviously he is referring to the Storray Engine [tm] here.
-
Last.fm (formerly known as Audioscrobbler) TDWTF group
Although I am not a very active member of The Daily WTF's community (one might rather say not active at all), I read and enjoy every WTF and especially the manifold witty comments provided by the readers here for quite a while now. And because I like this community so much, I just had to create a group for it at last.fm, formerly (and maybe better) known as Audioscrobbler. Feel free to join! Might be interesting to see what kind of music most people here like to listen to. But then again, maybe not that interesting. But still!
Just in case the links don't appear, here's the group's full URI: http://www.last.fm/group/The%2BDaily%2BWTF