User (Old forums)MemberOctober 23, 2003 at 1:44 pmPost count: 23064
This is first time i tried xceed.
i tought it will be quickly. but does not work with xceed.
The most compicated grid i ever seen. Don’t know how to get selected Row,
something simular to RowSel on other grids. Sounds terrible, but i can not find it out.
can i get some help ?
Imported from legacy forums. Posted by roland100 (had 3755 views)Xceed SupportMemberOctober 24, 2003 at 1:07 pmPost count: 5658
The grid can have more than one selected row. To access the selected rows, you can consult the grid’s SelectedRows property.
Keep in mind that the current row is not necessarily selected. If you want to access the current row, then you can consult the grid’s CurrentRow property.
I hope this helps!
Imported from legacy forums. Posted by Jenny [Xceed] (had 284 views)User (Old forums)MemberOctober 25, 2003 at 11:39 amPost count: 23064
thanks for an asnwer.
i am not sure it’s work correct.
my grid contains dataRows. and i am allow to select only one row for now
CurentRow which is Row and dataRow two differ classes.
at the same time this expample does not work.
foreach( Row row in gridControl1.SelectedRows )
if (row is DataRow)
gridControl1.SelectedRows.Remove( row );
it throw exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
Sorry! seems to me i am missing something.
Imported from legacy forums. Posted by roland100 (had 319 views)User (Old forums)MemberOctober 25, 2003 at 5:47 pmPost count: 23064
That is because you are removing rows from the beginning to the end. This will cause problems because the next row won’t be the next row upon next iteration of the loop because you are removing a row, and all other rows will be reordered. The way to stop this is going from the last to the first.
You need to do something like:
for(int i = gridContro1.SelectedRows.Count; i > 0; i–)
if(gridControl1.SelectedRows(i) is DataRow)
Imported from legacy forums. Posted by hellswraith (had 4621 views)
- You must be logged in to reply to this topic.