Adding Columns toDataGridView from WebService

LuckyJim1001

New member
Joined
Feb 28, 2010
Messages
1
Programming Experience
3-5
Hi all,

I have a dataset from a WebService that returns 44 columns. I only want 3 or 4 of those to display in my DGV.

I have 'sussed' it out one way by creating a new dataset from the original and then assigning that to the DGV but this just doesnt feel elegant enough.

So I turned off the autogeneratecolumns on the DGV and then tried to manually add the columns I wanted.

I used:-

With uxDataReturnedGrid
.Columns.Add("ADDRESS", "Full Address")
<some more columns>
end with

I used the column name (for example "ADDRESS") that sits in the main dataset but it does not copy over the rows. Makes sense I guess but I was hoping for the DGV, whose binding is to the full dataset returned, to say 'Ah he wants the ADDRESS column and all it's data"

Obviously does not work that way. I am guessing I need to fill the columns with the relevant rows but that seems like a lot of work.

Is there a better way of doing this ?

Apologies for a noob post.
 
Back
Top