Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. DataGridView problem

DataGridView problem

Scheduled Pinned Locked Moved C#
helpvisual-studio
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kallileo
    wrote on last edited by
    #1

    I create a DataSet with 4 tables in it from a mdb file using the Wizard of the VS Express 2008. I have a DataGridView and I display the data of the "Transaction" table. I also have a table with my suppliers called "Suppliers". In "Transaction" table I have a column called "Supplier". I have enabled the options to add,edit or delete record in the DataSet and to save all the changes back to the mdb file. To provide an easier way for the user to add new records I set "Supplier" columnType in the DataGridView as DataGridViewComboBoxColumn and DisplayMember, DataSource and ValueMember to the "Name" column in the Supplier table so the user can directly select the name name of the supplier without having to type it. So when I run the program and load the form I get the following error message: System.ArgumentException: DataGridViewComboBoxCell value is not valid. Any help would be appreciated.... Thank you

    H Mircea PuiuM 2 Replies Last reply
    0
    • K kallileo

      I create a DataSet with 4 tables in it from a mdb file using the Wizard of the VS Express 2008. I have a DataGridView and I display the data of the "Transaction" table. I also have a table with my suppliers called "Suppliers". In "Transaction" table I have a column called "Supplier". I have enabled the options to add,edit or delete record in the DataSet and to save all the changes back to the mdb file. To provide an easier way for the user to add new records I set "Supplier" columnType in the DataGridView as DataGridViewComboBoxColumn and DisplayMember, DataSource and ValueMember to the "Name" column in the Supplier table so the user can directly select the name name of the supplier without having to type it. So when I run the program and load the form I get the following error message: System.ArgumentException: DataGridViewComboBoxCell value is not valid. Any help would be appreciated.... Thank you

      H Offline
      H Offline
      Harvey Saayman
      wrote on last edited by
      #2

      yeah that DataGridViewComboBoxColumn is a tricky lil bugger! ive had a problem with mine for almost two weeks now. but my problem is that the table in question references itself good luck tho

      Harvey Saayman - South Africa Junior Developer .Net, C#, SQL think BIG and kick ASS

      you.suck = (you.passion != Programming)
      
      1 Reply Last reply
      0
      • K kallileo

        I create a DataSet with 4 tables in it from a mdb file using the Wizard of the VS Express 2008. I have a DataGridView and I display the data of the "Transaction" table. I also have a table with my suppliers called "Suppliers". In "Transaction" table I have a column called "Supplier". I have enabled the options to add,edit or delete record in the DataSet and to save all the changes back to the mdb file. To provide an easier way for the user to add new records I set "Supplier" columnType in the DataGridView as DataGridViewComboBoxColumn and DisplayMember, DataSource and ValueMember to the "Name" column in the Supplier table so the user can directly select the name name of the supplier without having to type it. So when I run the program and load the form I get the following error message: System.ArgumentException: DataGridViewComboBoxCell value is not valid. Any help would be appreciated.... Thank you

        Mircea PuiuM Offline
        Mircea PuiuM Offline
        Mircea Puiu
        wrote on last edited by
        #3

        Check the AutoSizeMode property of your DataGridView. You may have set some column(s) to expand the column width to fit the data. Depending on what data you have there (or actually you don't have :-)), you will get that kind of error if the lookup is turned on.

        SkyWalker

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups