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
Mark Mashup
NA
10
2.9k
i have student mark, then one student absent do datagridview
Aug 13 2015 1:41 AM
if (dataGridView2.CurrentCell.ColumnIndex < 5)
{
int sum = 0;
//int average = 0;
for (int j = 0; j < dataGridView2.Rows.Count - 1; j++)
{
for (int i = 0; i < dataGridView2.Columns.Count - 2; i++)
{
//char a = 'a';
if (dataGridView2.Rows[j].)
{
}
//{
// a='0';
// dataGridView2.CurrentRow.Cells[i].Value = dataGridView2.CurrentCell.RowIndex.ToString();
//}
//if else(dataGridView2.CurrentCell.RowIndex!='a')
sum += Convert.ToInt32(dataGridView2.Rows[j].Cells[i].Value);
}
} dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells["dgvctotal"].Value = sum.ToString();
int b = (int.Parse(sum.ToString())) / (int.Parse(dataGridView2.Columns.Count.ToString()) - 2);
dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells["dgvcaverage"].Value = b.ToString();
}
}
Reply
Answers (
2
)
DataGridView
How to user spell checker for ritchtext box in winforms