Click here to Skip to main content
15,890,336 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
richardw482-Oct-08 3:42
richardw482-Oct-08 3:42 
AnswerRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
RaltonLewis2-Oct-08 3:55
RaltonLewis2-Oct-08 3:55 
GeneralRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
richardw482-Oct-08 4:12
richardw482-Oct-08 4:12 
GeneralRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
RaltonLewis2-Oct-08 4:26
RaltonLewis2-Oct-08 4:26 
GeneralRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
richardw482-Oct-08 4:44
richardw482-Oct-08 4:44 
GeneralRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
richardw482-Oct-08 4:59
richardw482-Oct-08 4:59 
GeneralRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
RaltonLewis2-Oct-08 7:11
RaltonLewis2-Oct-08 7:11 
GeneralRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
richardw482-Oct-08 9:02
richardw482-Oct-08 9:02 
Mmm... I figured you might have a many-to-one relationship somewhere. Unfortunately the datagridview displays its data on a row-by-row basis so as soon as you assign a datasource it will display the data from the table, row by row. It's possible to show hierarchical data in the datagrid view by having related records appear as part of the main record but not as extra/additional columns. Instead you'll have extra rows beneath the parent row but these rows will be 'contained' within and below the parent row.

If you've managed to do everything I've said in the previous posts then all that's left to do now is to assign the datasource to the datagridview.

Open the form that has the datagridview on it in design view.
Select the datagridview and look at it's top-right corner, you should see a 'smart tag' appear. Click it and use 'Choose Data Source' to navigate to select the main table in your dataset. VS should then set up the data source automatically for you and you should be able to see the records displayed in the grid when you run your app.

To see the datagridview display records hierarchically you need to assign the datagridview's datasource to be the object that represents the relationship between the main table and the sub-table(s).

I wish I could see your tables structure and relationships then I'd be able to advise you better.
GeneralRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
RaltonLewis2-Oct-08 10:19
RaltonLewis2-Oct-08 10:19 
GeneralRe: How Do I Add A New Column For Each Record From Table To Existing DatagridView Pin
richardw482-Oct-08 22:06
richardw482-Oct-08 22:06 
Questionopen window using vb Pin
jhyn2-Oct-08 2:07
jhyn2-Oct-08 2:07 
AnswerCheck this CodeProject article Pin
David Mujica2-Oct-08 3:04
David Mujica2-Oct-08 3:04 
QuestionRe: open window using vb Pin
richardw482-Oct-08 3:45
richardw482-Oct-08 3:45 
AnswerRe: open window using vb Pin
jhyn2-Oct-08 15:50
jhyn2-Oct-08 15:50 
QuestionRe: open window using vb Pin
richardw482-Oct-08 22:11
richardw482-Oct-08 22:11 
QuestionVS 2008 Express - need to create a setup package Pin
Anoop Brijmohun2-Oct-08 0:22
Anoop Brijmohun2-Oct-08 0:22 
AnswerRe: VS 2008 Express - need to create a setup package Pin
Johan Hakkesteegt2-Oct-08 1:47
Johan Hakkesteegt2-Oct-08 1:47 
AnswerRe: VS 2008 Express - need to create a setup package Pin
jzonthemtn2-Oct-08 6:01
jzonthemtn2-Oct-08 6:01 
GeneralRe: VS 2008 Express - need to create a setup package Pin
Paul Conrad2-Oct-08 9:35
professionalPaul Conrad2-Oct-08 9:35 
GeneralRe: VS 2008 Express - need to create a setup package Pin
Anoop Brijmohun2-Oct-08 20:27
Anoop Brijmohun2-Oct-08 20:27 
QuestionWinForms DatagridView Field Pin
MatthysDT1-Oct-08 23:12
MatthysDT1-Oct-08 23:12 
AnswerRe: WinForms DatagridView Field Pin
George B Gilbert2-Oct-08 6:40
George B Gilbert2-Oct-08 6:40 
GeneralRe: WinForms DatagridView Field Pin
MatthysDT2-Oct-08 20:07
MatthysDT2-Oct-08 20:07 
GeneralRe: WinForms DatagridView Field Pin
George B Gilbert3-Oct-08 9:48
George B Gilbert3-Oct-08 9:48 
GeneralRe: WinForms DatagridView Field Pin
MatthysDT6-Oct-08 2:13
MatthysDT6-Oct-08 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.