Click here to Skip to main content
15,913,941 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Wide table visualization Pin
jschell20-Feb-12 9:55
jschell20-Feb-12 9:55 
AnswerRe: Wide table visualization Pin
Luc Pattyn20-Feb-12 12:18
sitebuilderLuc Pattyn20-Feb-12 12:18 
Out of curiosity I performed a little experiment, with the following code inside the Form's Load handler (dgv is a DataGridView):

C#
  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 !!! Pin
TPIRick7-Mar-12 10:09
TPIRick7-Mar-12 10:09 
Question.Net 4.0 Win Forms Caching? Pin
julian@giant16-Feb-12 3:34
julian@giant16-Feb-12 3:34 
AnswerRe: .Net 4.0 Win Forms Caching? Pin
Pete O'Hanlon16-Feb-12 3:41
mvePete O'Hanlon16-Feb-12 3:41 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant16-Feb-12 4:59
julian@giant16-Feb-12 4:59 
AnswerRe: .Net 4.0 Win Forms Caching? Pin
Luc Pattyn16-Feb-12 4:06
sitebuilderLuc Pattyn16-Feb-12 4:06 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant16-Feb-12 4:54
julian@giant16-Feb-12 4:54 
AnswerRe: .Net 4.0 Win Forms Caching? Pin
Luc Pattyn16-Feb-12 5:11
sitebuilderLuc Pattyn16-Feb-12 5:11 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant16-Feb-12 5:19
julian@giant16-Feb-12 5:19 
AnswerRe: .Net 4.0 Win Forms Caching? Pin
Luc Pattyn16-Feb-12 5:33
sitebuilderLuc Pattyn16-Feb-12 5:33 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant16-Feb-12 6:13
julian@giant16-Feb-12 6:13 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant22-Feb-12 5:04
julian@giant22-Feb-12 5:04 
AnswerRe: .Net 4.0 Win Forms Caching? Pin
Luc Pattyn22-Feb-12 5:10
sitebuilderLuc Pattyn22-Feb-12 5:10 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant22-Feb-12 5:32
julian@giant22-Feb-12 5:32 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
Dave Kreskowiak16-Feb-12 6:04
mveDave Kreskowiak16-Feb-12 6:04 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant16-Feb-12 6:15
julian@giant16-Feb-12 6:15 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
Luc Pattyn16-Feb-12 6:36
sitebuilderLuc Pattyn16-Feb-12 6:36 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant16-Feb-12 22:17
julian@giant16-Feb-12 22:17 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
AspDotNetDev18-Feb-12 22:11
protectorAspDotNetDev18-Feb-12 22:11 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
Eddy Vluggen19-Feb-12 5:38
professionalEddy Vluggen19-Feb-12 5:38 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant20-Feb-12 6:19
julian@giant20-Feb-12 6:19 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
Eddy Vluggen20-Feb-12 6:28
professionalEddy Vluggen20-Feb-12 6:28 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
Pete O'Hanlon16-Feb-12 5:14
mvePete O'Hanlon16-Feb-12 5:14 
GeneralRe: .Net 4.0 Win Forms Caching? Pin
julian@giant16-Feb-12 5:20
julian@giant16-Feb-12 5:20 

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

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