Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Repeater paging problem

Reply
Thread Tools

Repeater paging problem

 
 
Viktor Popov
Guest
Posts: n/a
 
      09-22-2004
Hi,

I'm trying to do the following but I can't understand what's wrong. Could
you help me here!
I do paging with a Repeater like this:

DataSet ds = new DataSet();
dad.Fill(ds, "MyOffers");
if(ds.Tables[0].Rows.Count==0)
Delete.Enabled=false;

PagedDataSource objPds = new PagedDataSource();
objPds.DataSource = ds.Tables[0].DefaultView;
objPds.AllowPaging = true;
objPds.PageSize = 14;
int CurPage;
int FirstPage=1;
int LastPage=objPds.PageCount;
if (Request.QueryString["Page"] != null)
CurPage=Convert.ToInt32(Request.QueryString["Page"]);
else
CurPage=1;
objPds.CurrentPageIndex = CurPage-1;
lblCurrentPage.Text = "No?aieoa ?: " + CurPage.ToString() + " io iaui " +
objPds.PageCount.ToString();
if(!objPds.IsFirstPage)
lnkFirst.NavigateUrl=Request.CurrentExecutionFileP ath +"?Page=" +
Convert.ToString(FirstPage);
if(!objPds.IsFirstPage)
lnkPrev.NavigateUrl=Request.CurrentExecutionFilePa th + "?Page=" +
Convert.ToString(CurPage-1);
if(!objPds.IsLastPage)
lnkNext.NavigateUrl=Request.CurrentExecutionFilePa th + "?Page=" +
Convert.ToString(CurPage+1);
if(!objPds.IsLastPage)
lnkLast.NavigateUrl=Request.CurrentExecutionFilePa th + "?Page=" +
Convert.ToString(LastPage);
MyRepeater.DataSource=objPds;
MyRepeater.DataBind();

On this page I have a DELETE_BUTTON. When I have more than 14 results(more
than 1 page) and when I push the Button it doesn't work. When I go to the
last page and push the button the code in ON_CLICK_METHOD works. I can't
understand why. Could you help me here?

Thanks a lot!

Viktor



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.767 / Virus Database: 514 - Release Date: 21.9.2004 a.


 
Reply With Quote
 
 
 
 
Viktor Popov
Guest
Posts: n/a
 
      09-22-2004
Here it is the code for DELETE_BUTTON. I do loop through the RepeaterItems
and check if a CheckBox
control is checked:
private void Delete_Click(object sender, System.EventArgs e)
{
Session["queryStr"]=",";
int f=0;
foreach(RepeaterItem item in MyRepeater.Items)
{
CheckBox cb1 = item.FindControl("cb") as CheckBox;
CheckBox cb2 = item.FindControl("lbl") as CheckBox;
if(cb1.Checked==true)
{
Session["queryStr"]=Session["queryStr"].ToString()+cb2.Text+",";
f++;
}
}
if(f==0)
return;
Response.Redirect("dltad.aspx");
}
If a CheckBox from a row is Ckecked The Session["queryStr"]=the id of the
element which must be deleted and forwards to delete them in onether form.

Thank you!

Viktor



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.767 / Virus Database: 514 - Release Date: 21.9.2004 a.


 
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
datagrid paging - customising paging style wh1974 ASP .Net 0 01-12-2005 03:48 PM
DataSet paging vs Datareader paging =?Utf-8?B?UGF0cmljay5PLklnZQ==?= ASP .Net 1 10-08-2004 02:13 PM
Repeater paging problem Viktor Popov ASP .Net Web Controls 13 09-23-2004 09:59 PM
Repeater paging problem Viktor Popov ASP .Net Building Controls 1 09-22-2004 10:49 AM
Repeater paging problem Viktor Popov ASP .Net Security 0 09-22-2004 08:29 AM



Advertisments