Click here to Skip to main content

.NET Framework

   

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
AnswerRe: Wide table visualization PinmvpLuc Pattyn6:54 16 Feb '12  
AnswerRe: Wide table visualization PinmemberBernhard Hiller20:54 16 Feb '12  
GeneralRe: Wide table visualization PinmemberTPIRick3:12 17 Feb '12  
AnswerRe: Wide table visualization PinmvpDave Kreskowiak4:08 18 Feb '12  
AnswerRe: Wide table visualization PinmemberEddy Vluggen4:15 18 Feb '12  
AnswerRe: Wide table visualization Pinmemberjschell9:55 20 Feb '12  
AnswerRe: Wide table visualization PinmvpLuc Pattyn12:18 20 Feb '12  
Out of curiosity I performed a little experiment, with the following code inside the Form's Load handler (dgv is a DataGridView):
 
  1  for (i=0; i<10000; i++) {
  2      DataGridViewColumn col=new DataGridViewTextBoxColumn();
  3      if (i==0) {
  4          log("col.Width="+col.Width);
  5          log("col.FillWeight="+col.FillWeight);
  6      }
  7      col.Name=i.ToString();
  8      // col.FillWeight=3;
  9      dgv.Columns.Add(col);
 10  }
 
As is, it fails when i=655 with the Exception you've got, because the default FillWeight value is 100, and it somehow gets summed in an unsigned short which then overflows.
 
With line 8 uncommented, it runs fine. That is, if you have half an hour to spare, waiting for the DGV to get loaded with (empty) columns. After the long wait, the Form and the DGV appear, with column headers, scrollbars, and everything (except for rows and actual data, as I didn't provide any).
 
The conclusion can only be:
1. a DGV wasn't meant to hold that many columns;
2. your app needs another way to interact with your user.
 
Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

AnswerWORKAROUND/SOLUTION !!! PinmemberTPIRick10:09 7 Mar '12  
Question.Net 4.0 Win Forms Caching? Pinmemberjulian@giant3:34 16 Feb '12  
AnswerRe: .Net 4.0 Win Forms Caching? PinprotectorPete O'Hanlon3:41 16 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? Pinmemberjulian@giant4:59 16 Feb '12  
AnswerRe: .Net 4.0 Win Forms Caching? PinmvpLuc Pattyn4:06 16 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? Pinmemberjulian@giant4:54 16 Feb '12  
AnswerRe: .Net 4.0 Win Forms Caching? PinmvpLuc Pattyn5:11 16 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? Pinmemberjulian@giant5:19 16 Feb '12  
AnswerRe: .Net 4.0 Win Forms Caching? PinmvpLuc Pattyn5:33 16 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? Pinmemberjulian@giant6:13 16 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? Pinmemberjulian@giant5:04 22 Feb '12  
AnswerRe: .Net 4.0 Win Forms Caching? PinmvpLuc Pattyn5:10 22 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? Pinmemberjulian@giant5:32 22 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? PinmvpDave Kreskowiak6:04 16 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? Pinmemberjulian@giant6:15 16 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? PinmvpLuc Pattyn6:36 16 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? [modified] Pinmemberjulian@giant22:17 16 Feb '12  
GeneralRe: .Net 4.0 Win Forms Caching? PinprotectorAspDotNetDev22:11 18 Feb '12  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Beta | 2.5.120517.1 | Last Updated 21 May 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid