hello
I have problem not getting total from GridView.
i have 3 thing
1- total Rating lbl0.Text = "0";
2- total NotRatinlbl1.Text = "0";
3 total all users lblUk2.Text = "0";
private void GetCounts(DataTable dt)
{
lbl0.Text = "0";
lbl1.Text = "0";
lblUk2.Text = "0";
var result = from row in dt.AsEnumerable()
group row by row["UpdateRating"] into g
select new
{
country = g.Key,
count = g.Count()
};
foreach (var key in result)
{
if (key.country.ToString().ToLower() == "Rating")
{
lbl0.Text = key.count.ToString();
}
else if (key.country.ToString().ToLower() == "NotRating")
{
lbl1.Text = key.count.ToString();
}
int CountVotes = 0;
GridViewRow row = null;
for (int i = 0; i < GridView1.Rows.Count; i++)
{
row = GridView1.Rows[i];
bool isChecked = ((CheckBox)row.FindControl("CheckBox1")).Checked;
if (isChecked)
{
CountVotes++;
}
}
lblUk2.Text = CountVotes.ToString();
}
}