I'd like to be able to copy highlighted rows in wingrid and paste them into the same grid as new rows. I've seen other forum topics on this, but they're all very old and from what I can see they don't always work. What's the current suggested method for doing this?
Well, I'm out of ideas, then.
Unless you are using an old version of the controls. Perhaps this is an old bug that was already fixed.
I suppose it's also possible that something in your code is modifying the clipboard data. You might try taking a look at which events of the grid you are handling and see if maybe commenting out the code for some of those events makes the problem go away. In particular, see if you are handling Before/AfterMultiCellOperation.
If not, it looks like we will need a sample so we can reproduce the problem and debug it. If you can't reproduce the issue by creating a new sample with the same data, then perhaps you could make a copy of your real application and try to reduce it down to something we could run.
There's nothing odd about the data, it's a simple string. And it's not RO or it wouldn't be able to paste for a single row. And there's no ValueList attached to it either. It's a simple data-bound col.
The error message you are getting for #1 relates to the grid either interacting with it's own rows collection or with the local data source. So it doesn't relate to the database or any kind of query... unless, like I said, the query you are using is somehow indirectly causing this by telling the DataSource to not allow nulls in a specific field. Of course, since you already said the data is NOT null and it works for a single row, there must be something else going on there. Is there anything unusual about the DataType of the column the error is occurring on? Or is there a ValueList attached to that column? Is it possible that the column is read-only in the grid so that the new row being pasted can't write that field and that's why it's null? Is this the same Identity column from question #2?
Well that's just my guess. I wanted to see the query so I could see if that were the problem. I figured that since you're so much better at .NET than I that you would know how to do it. I'm a DBA by trade.
Well... that query would be between your database and the grid's DataSource (presumably a DataSet or DataTable). The grid has NO interaction with the DataBase or that communication. It only deals with the local data source. Unless your query is having some effect on the DataSource, like it's changing one of the fields to not allow nulls, I don't see how that could possibly have anything to do with copy and pasting.