TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
hodaya
NA
1
1.3k
Redraw C#
Dec 3 2013 3:33 AM
Hi there,
We have
a DataGridView and the following code:
private void button1_Click(object sender, EventArgs e)
{
dataGridView1.Rows.Add(15);
int k = dataGridView1.Rows.Count - 1;
for (int i = 0; i < k; i++)
dataGridView1.Rows[i].Cells[0].Value = i;
}
We want that the changes will occur after cliking on the button.
We
tried to change code to:
private void button1_Click(object sender, EventArgs e)
{
dataGridView1.SuspendLayout();
dataGridView1.Rows.Add(15);
int k = dataGridView1.Rows.Count - 1;
for (int i = 0; i < k; i++)
dataGridView1.Rows[i].Cells[0].Value = i;
dataGridView1.ResumeLayout(false);
}
but adding this rows didn't help.... :(
Someone know why?
Reply
Answers (
0
)
for and foreach
cannot implicitly convert type to system.collection.generic.