|
-
Dec 21st, 2008, 11:21 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Changing Data in Selected Rows
This has turned out to be more complex than expected. I'm throwing it out there in case anyone has had to deal with a similar situation in the past.
The short version: I need to loop through the selected rows of a bound datagridview, and make similar changes to each record, when some of the cells being changed may also be part of the SortedColumn.
The long version: I've been trying to use a foreach loop on the selected rows, but the problem is the sorting: if one of the column's due to change is the column the list is being sorted by, then data ends up everywhere: I believe my selection is lost the moment it is resorted.
I've tried several solutions, including manually sorting them (I lose the selection), dropping the selected rows into a List and re-selecting them after the sort (was told that the row's were not part of the DataGridView), and even turning off sorting (which works, but makes the application impossibly hard to use).
Any help? All I need to do is apply the same changes to all the currently selected rows.
Thanks,
Qu.
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
| Pong| |
Sorry for not posting more often.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|