Click here to Skip to main content
12,457,331 members (57,013 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# 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 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 28-Dec-12 7:17am
   
things is I dont get exception message, it just stands that, with nothing happening
jibesh 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
Top Experts
Last 24hrsThis month


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100