Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Hello
 
I have a little issue with selecting all rows in datagridview.
 
Ok, I have a datagridview with 20 visible columns, and 10 invisible (for program purposes I made those invisible)
 
and I have a button with
 
datagridview.SelectAll();
 
and that works fine when datagridview is populated with 50 rows, but as the number of populated rows gets up, so the the time to select all those rows on button click gets also higher. until around 3500 rows when it simplY crashes down.
now I have tried with selectionmode to change to CellSelect and that works fine but the thing is when you change to CellSelect then rows arent selected which I need in further work of my application. so I figured there is some problem with those inivisible columns
 
Solutions, most welcome Smile | :)
Posted 28-Dec-12 0:02am
Comments
jibesh at 28-Dec-12 7:05am
   
did you able to find the reason why it crashes? if you can paste the exception stack we might able to help you
shonezi at 28-Dec-12 7:17am
   
things is I dont get exception message, it just stands that, with nothing happening
jibesh at 28-Dec-12 16:46pm
   
It means the code is executing to select the cells doing some extensive tasks. double check is there any extensive operation inside the datagrid.SelectionChanged event or cellSelection changed event.
 
do some trail and error method by removing all the datagrid event subscription and apply select all. normally it shouldnt take too much time just to select the cells

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 428
1 Maciej Los 260
2 Sergey Alexandrovich Kryukov 220
3 DamithSL 208
4 Dave Kreskowiak 200


Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 28 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid