Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

c# - Datagridview column limit

I have a datagridview table that I need to display some data in. In certain instances, I exceed the column number limit and get the following error:

Sum of the columns' FillWeight values cannot exceed 65535

Is there any other tool that I could use to overcome this constraint?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Open a grid event columnAdded.

private void dataGridViewName_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
    e.Column.FillWeight = 10;    // <<this line will help you
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...