Hi, I've edited my original message to make it easier to read and updated it to my current situation so please ignore my 2 subsequent posts.
I've added a checkbox column with select all checkbox header to my webgrid as per this forum post http://forums.labs.infragistics.com/forums/p/1156/11700.aspx#11700
A copy and paste method which moves the selected rows to another grid is now exhibiting very strange behaviour.
Initially when I did grid.copy() after using the select all checkbox to select all the rows the copy was failing. If I checked all the rows manually it worked fine. I resolved this issue by adding a line to activate the row before selecting it and copying it.
Now if I just use the select all button and then copy it all works fine.
However if I first manually check and copy the first row (which works fine), then use select all and copy to copy the rest of the rows the first row of the rest of the rows doesn't get copied correctly and only the checkbox value gets copied but all the subsequent rows copy correctly.
Similarly, if I've only got 2 rows in the grid and I manually copy the last row then the checkbox value only will be copied for the first row if I use the select all and copy. However if there are more than 2 rows and I copy the last row first, then select all and copy the rest they all copy correctly.
Any suggestions or help would be much appreciated.
Thanks,
Colette
Bump.
I've managed to get a little further with this.
In the CopyMultipleRows function I was selecting a row before I copied it, but now I activate the row before it is selected and copied and this seems to have helped the Select All issue at least superficially.
copyGrid.clearSelectionAll(); copyRow.activate(); copyRow.setSelected(true); copyGrid.copy();
However, it's behaviour is now decidedly weird.
When I copy the first row (or the last row if there are only 2 rows) by clicking the checkbox then the copy button to move it to the other grid, then I use the Select All checkbox to select the remaining checkboxes in the grid and hit copy, the copy for the first row only picks up the checkbox value and not the contents of the rest of the row, all subsequent rows seem to copy correctly.
If I copy the last row (when there are more than 2 rows), or any row from the middle of the table first manually, then use the Select All checkbox and copy to copy the rest of the rows then all rows are copied correctly
I thought initially that it was because I was removing a row from the grid before running the second copy and that because the row numbers weren't sequential that this was causing a problem but I would expect the behaviour to be consistent and it's not.
The plot thickens. Here are some more details on the problem that I've come across during testing.
I'm using the grid to enter search terms and then display the results. So the user enters a value in a particular column, hits Search and then a search is run for that value using the column name and the results are returned and bound to the grid.
If I enter some text, don't search, click the Select All checkbox and then click the copy button everything works fine, the row is copied to the clipboard.
However, if I enter some text, do click Search, click Select All and then copy the checkboxes are set but the copy is failing.
And as I mentioned before, if I've run the search and then manually click the checkboxes for the rows I want, then hit copy again each row is copied to the clipboard correctly.
So it's only after I've run the search and used the select all checkbox that the copy is failing.
Could it be something to do with the way the data is bound to the page? It doesn't seem to be doing a postback and the search data certainly remains visible after clicking the Select All checkbox.
I need a solution to this quite urgently so any help is much appreciated.