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: for customized pasting operation first row is moved to end of the grid instead of getting overwritten!!!! [modified]

DataGridView: for customized pasting operation first row is moved to end of the grid instead of getting overwritten!!!! [modified]

Scheduled Pinned Locked Moved C#
cssvisual-studiodebugginghelpquestion
1 Posts 1 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.
  • C Offline
    C Offline
    Cracked Down
    wrote on last edited by
    #1

    I have derived a custom control from the DataGridView to enable pasting operation from the Clipboard. I am able to do almost all the operation of pasting except the following Scenario : 1. Added the custom DataGridView to form 2. AlloUserToAddRows = true and I have also set some other required property of custom DataGridView 3. when I turn AlloUserToAddRows = true , VS adds a one default row to grid 4. so I used the following steps to reproduce the bug a. I run application and paste the data in each cell individually on the default added row it does not add any additional row to grid b. I copied some rows from excel sheet and tried to paste in grid by selected first cell (as current cell) c. Programmatically, I have to calculate the number of rows required to add in grid for pasting operation which I did , and using this.Rows.Add(n); to add n number of rows (I also tried with Insert()) d. While using Add() function everything works fine except that the first row is moved to end of the grid (only in the above mentioned scenario; for everything else it works fine) e. While using Insert () method overloads, I am getting the exception (on same line in debug mode) InvalidOperationException with message as “no row can be inserted after the uncommitted new row.” 5. I tried many things to get work around for this bug, however I didn’t succeeded Anybody knows the any approach where I can either get rid of this bug or exception? suggestions are also welcome!! Reg, Deep Happy Coding

    modified on Monday, August 24, 2009 5:56 AM

    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