Post by Ronald Celi » Mon, 25 Nov 2002 02:03:51


Does anybody know  how to retrive the list of selected rows in the

For example, i have a datagrid that is populated from my customer table, by
default it let me highlight more than 1 row, for me this rows are going to
be the ones that the user want to delete, so i want to get this list so i
can delete them all from the table, then refresh the datagrid with the
remaining records.

thanks for any help




Post by Rames » Tue, 26 Nov 2002 23:56:52

DataGrid.IsSelected method can tell you if a particular row is selected.
So, you could use IsSelected in a loop through all your rows to finds if
multiple rows have been selected.

Hope this helps.

Ramesh Thyagarajan, MCSD,MCDBA
Microsoft Developer support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit


1. Need some help with DataGrids (DataGrid-->DataGrid, DataGrid-->Dataset, DataGrid-->XML)

[This followup was posted to microsoft.public.dotnet.general and a copy was sent to the cited author.]

#1  I have 2 windowsforms, and they each have a datagrid in them.  How
do I copy "easily" copy the contents of the one datagrid to the other?  
(Assuming that the datasource of the 1st datagrid is no longer

#2  How do I "export" a datagrid to a dataset?  All examples of
datagrids/datasets show dataset-->datagrid -not- datagrid-->dataset.  

#3  (Well if I had an answer to #2 I guess I'd have an answer to #3)  I
saw this asked before and noone answered it...  How do you export a
datagrid to XML?  If we could export to a dataset, it would be easy from
there... but is there a better way?

2. Network has slowed

3. DataGrid in DataGrid: Can't find DataGrid in Datagrid

4. Smartjoy-X USB adapter for XboxT controller to PC

5. Datagrid - Can I ge the index of a datagrid column by passing the datagrid column name?

6. How to Clear OE Headers

7. Binding controls to DataGrid + Sync DataGrid with Navigation Button

8. nvram bytes free

9. DataReader into a DataGrid / DataView into a DataGrid

10. datagrid sort (

11. How to locate the selected row of the datagrid to a specifc row in the datagrid

12. Using a combo box in a DataGrid / Child rows in a DataGrid

13. How to assign arraylist to DataGrid in window form datagrid