I
icanhelp33
I would like to assign dynamic pagesize to a gridview called
gridCustomer. The customer data is a List with a column called
groupId . When a new groupid is encountered I would like to display
data in a new page. The code doesn't seem to work. Can you please
help.
gridCustomer.DataSource = customer;
int groupId,groupRowId,count;
groupId = 1;
for (int i = 0; i < gridCustomer.Rows.Count; i++)
{
GridViewRow row = gridCustomer.Rows;
Label lblGroupId =
(Label)row.FindControl("GroupId");
groupRowId = Convert.ToInt32(lblGroupId.Text);
if (groupId == groupRowId)
{
count = count + 1;
}
else
{
gridCustomer.PageSize = count;
count = 0;
groupId = groupId + 1;
}
}
gridCustomer.DataBind();
gridCustomer. The customer data is a List with a column called
groupId . When a new groupid is encountered I would like to display
data in a new page. The code doesn't seem to work. Can you please
help.
gridCustomer.DataSource = customer;
int groupId,groupRowId,count;
groupId = 1;
for (int i = 0; i < gridCustomer.Rows.Count; i++)
{
GridViewRow row = gridCustomer.Rows;
Label lblGroupId =
(Label)row.FindControl("GroupId");
groupRowId = Convert.ToInt32(lblGroupId.Text);
if (groupId == groupRowId)
{
count = count + 1;
}
else
{
gridCustomer.PageSize = count;
count = 0;
groupId = groupId + 1;
}
}
gridCustomer.DataBind();