Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Gridview Dynamic Pagesize

Reply
Thread Tools

Gridview Dynamic Pagesize

 
 
icanhelp33@gmail.com
Guest
Posts: n/a
 
      05-06-2008
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[i];
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();

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
number of rows in a gridview with pagesize? Vincent ASP .Net 2 03-10-2008 06:21 PM
Dynamic DataGrid PageSize rn5a@rediffmail.com ASP .Net 0 04-17-2007 12:32 AM
Setting GridView PageSize at runtime Adam Sandler ASP .Net 4 05-16-2006 08:34 PM
Dynamic height and pagesize adjustment of Grid Girish Prabhu ASP .Net Datagrid Control 0 01-27-2004 09:11 PM
Dynamic PageSize based on Browser body.clientHeight Rod Billett ASP .Net Datagrid Control 0 10-23-2003 09:48 PM



Advertisments