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
Muhammad Shah
NA
4
2.8k
How to get average of column of grid in case of null entry?
Dec 16 2015 4:08 PM
I want to get the sum and also the average of GridView column .If there is any "null" entries in the column then it is not give me the sum.
int i = 0;
int j = 0;
int sum = 0;
try
{
for (i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
for (j = 0; j < dataGridView1.Columns.Count; j++)
{
sum = sum + (Convert.ToInt32(dataGridView1.Rows[i].Cells[j].Value));
}
}
MessageBox.Show("sum"+sum);
}
I want to get average of the column and then place it in the null value cell.
any body help me
Reply
Answers (
2
)
cross threading seting form controls
store procedure