Results 1 to 5 of 5

Thread: Change data table of the DataGridViewComboBoxColumn-cell only for the new row ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2013
    Posts
    134

    Change data table of the DataGridViewComboBoxColumn-cell only for the new row ?

    The existing data contains values that are not allowed to be selected for new records. If I bind the whole combobox-column to the reduced dataset I get errors, as some old value keys have no counterpart in the reduced dataset comboboxbox.
    Is there a way to use the combobxcolum but to change the combo box for the new record row. If no, then I can add combo box cells to each row with the right selection.

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Change data table of the DataGridViewComboBoxColumn-cell only for the new row ?

    Nono!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2013
    Posts
    134

    Re: Change data table of the DataGridViewComboBoxColumn-cell only for the new row ?

    Thank you! I accept a "no" for my first question, but is the second no for my planned alternative solution?

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Change data table of the DataGridViewComboBoxColumn-cell only for the new row ?

    No the second no was because "No" is too short a reply to be accepted by the editor! I hadn't really considered your alternative but now I have it probably would get a 'no'. Is it necessary to view the records that have the invalid entries? If not then I would recommend you create a DataView to exclude them altogether from the grid. Otherwise, you'll have little choice but to create some kind of validation routine as insurance against anyone adding a record with the invalid choices (or simply bring all the records in the database up to date with regard to this column).
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  5. #5
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Change data table of the DataGridViewComboBoxColumn-cell only for the new row ?

    Ok, now I've just learnt something about DGVs that might suggest a way that you could do this using a customised cell type, I may have to have another think about this. I'd still prefer the data to be consistent but other possibilities do now arise.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

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