Kelvin81
asked on
.Net Beginner: Listview, DataGridView, or Whatever else
Hi,
I am new to VB.NET and I am trying to create a simple little application.
I finally figured out ADO.NET (as opposed to just ado) and wanted to now place the retrieved information out onto the form. It could be in a listview (which I tried) or a datagridview which looks pretty complicated unless it is bound beforehand to a datasource.
Oh, I think the problem I had with the listview was, more specifically, that I wasn't able to create a column header no matter how much I tried heh. I believe thats possible, but I am still a little shady on how it works.
I don't know the "right" or best way of doing it, so I am open to suggestions. If someone could help me out (my preference I think would be to make the listview work ) ...
Thanks in advance for your help and input with this.
Regards,
Kelvin
I am new to VB.NET and I am trying to create a simple little application.
I finally figured out ADO.NET (as opposed to just ado) and wanted to now place the retrieved information out onto the form. It could be in a listview (which I tried) or a datagridview which looks pretty complicated unless it is bound beforehand to a datasource.
Oh, I think the problem I had with the listview was, more specifically, that I wasn't able to create a column header no matter how much I tried heh. I believe thats possible, but I am still a little shady on how it works.
I don't know the "right" or best way of doing it, so I am open to suggestions. If someone could help me out (my preference I think would be to make the listview work ) ...
Thanks in advance for your help and input with this.
Regards,
Kelvin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That was remarkably easy. I created a function that returns a dataset.. so I just set ds.tables(0) equal to my datatable and just went with that and it worked wonderfully. Thanks nick.... although if you want to throw in the freebie about that function would be appreciated ;)
Hi,
Sorry, my mistake with the columns ... I obviously wan't thinking when I copied and pasted it in :-S
I dont quite understand which function you are asking about in your last comment .. was it the one I just mentioned, or was there something else that you were asking about?
Cheers
Nick
Sorry, my mistake with the columns ... I obviously wan't thinking when I copied and pasted it in :-S
I dont quite understand which function you are asking about in your last comment .. was it the one I just mentioned, or was there something else that you were asking about?
Cheers
Nick
ASKER
("Col1", "Col1", 100, HorizontalAlignment.Left, 0);
seems to have just been a typo.... hehe
seems to have just been a typo.... hehe
Hi,
I just looked it up to clarify, and it is actually correct ... the first string is the column key, and the second is the text to display.
http://msdn2.microsoft.com/en-us/library/5eyhefae.aspx
Cheers
Nick
I just looked it up to clarify, and it is actually correct ... the first string is the column key, and the second is the text to display.
http://msdn2.microsoft.com/en-us/library/5eyhefae.aspx
Cheers
Nick
ASKER
It does (as soon as I figure out how to use a datatable.. I believe i just create one out of the data adapter...
additionally... why do you repeate "col1" and "Col2" twice? (I could look it up, but I figured since your already helping....)