Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8781331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:16:26+00:00 2026-06-13T20:16:26+00:00

I have looked and found one question which was similar, though did not resolve

  • 0

I have looked and found one question which was similar, though did not resolve my issue – that other question was datagridview-is-blank-after-changing-datasource-at-runtime

I am sure this is a simple question with an even more simple answer..Working on my first Windows Forms application and finding some things a lot different from ASP.Net 🙂

So in this application I have the following:

  • Main Form
  • Toolbar on this form, opens up a second form to set application settings
  • This second form has a tab control (2 tabs) with various textboxes/checkboxes/combolists/buttons
    • All of these work perfectly.
  • On the second tab of this second form, along with more textboxes etc, I have added a DataGridView; called printerListGrid

In the code-view of this form I am trying to bind a List(Of Printer) to it

printerListGrid.DataSource = AppContext.printers.printerList

When I run my app and go to the form/tab the DataGridView is blank.

I have also tried:

    printerListGrid.Columns.Clear()
    printerListGrid.AutoGenerateColumns = True
    printerListGrid.DataSource = AppContext.printers.printerList

Again – it’s blank.

While debugging I can see that my printerList contains 2 printer objects. I can also see that these have been set to the printerListGrid by viewing the contents of the .DataSource property. Yet, the DataGridView is still blank.

I’m guessing there must be some way to re-render the grid?

For the sake of code-discolsure; this is what is in the List(Of Printer)

    Public Structure Printer
        Public id As Integer
        Public name As String
        Public material As Enums.Materials
        Public outputFolder As String
    End Structure

Let me know if there is any more code/description you need to provide help.

UPDATE:

I forgot to mention. I am trying to set the DataSource in a Private Sub which is called on the forms Load event MyBase.Load

UPDATE #2

I continue to play with this, trying to get it to work – I might be totally misunderstanding the control and its purpose.. anyway, I have also tried the following:

    printerListGrid.AutoGenerateColumns = False

    Dim col As DataGridViewColumn = New DataGridViewTextBoxColumn()
    col.DataPropertyName = "name"
    col.HeaderText = "Name"
    printerListGrid.Columns.Add(col)

    col = New DataGridViewTextBoxColumn()
    col.DataPropertyName = "material"
    col.HeaderText = "Material"
    printerListGrid.Columns.Add(col)

    col = New DataGridViewTextBoxColumn()
    col.DataPropertyName = "outputFolder"
    col.HeaderText = "Output Folder"
    printerListGrid.Columns.Add(col)

    printerListGrid.DataSource = AppContext.printers.printerList

This results in at least the grid showing rows; appears like 2. Yet they are not populated with the data from List(Of Printer)…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:16:27+00:00Added an answer on June 13, 2026 at 8:16 pm

    Found out what I did wrong. Basically try this:

    Public Structure Printer
        Property id As Integer
        Property name As String
        Property material As Enums.Materials
        Property outputFolder As String
    End Structure
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked but have not found a specific answer for changing just one
I'll preface this question with the note that I have looked at this similar
I have looked through the solutions and haven't really found one. I am getting
In my table I have looked manually and found that the top three idle
I have looked thoroughly, but I have not found the solution (or perhaps I
I've looked through several posts but I haven't quite found any answers that have
I have looked at many other threads that show how to use accelerometer values,
Looked for an answer for this question, but I haven't found a suitable one
I looked around and found other questions that had answers but none of them
I have looked for an answer of a long time and still not found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.