Results 1 to 7 of 7

Thread: Datagridview not binding or not working

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    17

    Datagridview not binding or not working

    i used the add a new data source wizard, were you click on your access file add what tables you want and all is good. then i created 5 different forms some with buttons with a different datagridviews of the tables on each, nothing fancy just a drag a drop and let visual studio 2005 do all the work. for some reason after the 4 form created all it does now is drops a datagridview with no data. i tried previously created ones and they all do the same thing no data in the datagridview. basically what should have happen is it normally creates a bindingnavigator were you get the buttons to cycle though the data, i get a dataset, a binding set, table adapter and a datagridview. i still get all that but the datagridview is blank. i even tried the same datasouce with a drag and dop on a form on another project and it worked fine. not sure if anyone can help any direction is appreciated.
    thanks

  2. #2
    Addicted Member
    Join Date
    Feb 2008
    Location
    Waterloo, ON
    Posts
    251

    Re: Datagridview not binding or not working

    You'll need to show some code.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    17

    Re: Datagridview not binding or not working

    the code is self generated all i can show is

    Code:
    Public Class ChamberLog
    
        Private Sub ChamberLog_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'TODO: This line of code loads data into the 'EventTrackerDataSet.Racktime' table. You can move, or remove it, as needed.
            Me.RacktimeTableAdapter.Fill(Me.EventTrackerDataSet.Racktime)
    
        End Sub
    
        Private Sub RacktimeBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RacktimeBindingNavigatorSaveItem.Click
    <a href="http://s444.photobucket.com/albums/qq169/underdoggy/?action=view&current=DataGridView1.jpg" target="_blank"><img src="http://i444.photobucket.com/albums/qq169/underdoggy/DataGridView1.jpg" border="0" alt="image"></a>
            Me.Validate()
            Me.RacktimeBindingSource.EndEdit()
            Me.RacktimeTableAdapter.Update(Me.EventTrackerDataSet.Racktime)
    
        End Sub
    End Class
    this is how it looks


    this is how it should look



    thanks

    sorry for the big pictures

  4. #4
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Datagridview not binding or not working

    Don't use wizards... Learn how to do it manually so that besides having total control on your code, you can understand what's going on.
    Most experience coders here do not use wizards (me included)m and since we don't use wizards, we are not familiar with them so we can't really help you much.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    17

    Re: Datagridview not binding or not working

    ok thanks ill do some searching on binding to datagrids.. oh well no worries

  6. #6
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: Datagridview not binding or not working

    I'd agree with Stanav re wizards. They're helpful while you're getting started but if you rely on them you never learn what's happening under the lid. You'll end up a better coder if you try to do things manually from time to time.

    anyway, what do the datasource and datamember properties on the grid show. It sound like they just haven't ben set. Also, look at the columns collection property of the grid. Are you're columns in there?
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    17

    Re: Datagridview not binding or not working

    its weird normally the wizard would create it all for you, so it should be there and when you add it manually it doesnt bring in the values from the table for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width