custom repeator with previous next button added at footer
-
hi all, i want to customize the repeator control with paging,with previous and next button added at footer of repeator, what i want to when repeator control added, then it should add the add the "next", previous button at footer of repeator by default. i have tried paging using pagedatasource class, it works, and added implemented the itemplate for template with previous next button as well. here is samples of code WebCustomControl1 : Repeater, ITemplate over ride oninit and do this protected override void OnInit(EventArgs e) { this.FooterTemplate = new WebCustomControl1(); base.OnInit(e); } implemented interface public void InstantiateIn(Control container) { code for previous and next buttons}. now the issue is instead of appearing at the bottom previous next buttons appears at the top of repeator,and i want them to appear at the bottom in footer section of template,all doing in custom control. previous"
Regards. Tasleem Arif
-
hi all, i want to customize the repeator control with paging,with previous and next button added at footer of repeator, what i want to when repeator control added, then it should add the add the "next", previous button at footer of repeator by default. i have tried paging using pagedatasource class, it works, and added implemented the itemplate for template with previous next button as well. here is samples of code WebCustomControl1 : Repeater, ITemplate over ride oninit and do this protected override void OnInit(EventArgs e) { this.FooterTemplate = new WebCustomControl1(); base.OnInit(e); } implemented interface public void InstantiateIn(Control container) { code for previous and next buttons}. now the issue is instead of appearing at the bottom previous next buttons appears at the top of repeator,and i want them to appear at the bottom in footer section of template,all doing in custom control. previous"
Regards. Tasleem Arif
instead of footer you can place 2 link buttons bellow repeater the code goes like this
public void Repeaterfill()
{
SqlDataAdapter da = new SqlDataAdapter("select a.Complaint_id,a.Emp_id,a.Decription,"
+ " substring(Convert(varchar,a.Problem_date),0,12) as Problem_date,substring(Convert(varchar,b.Resolved_Date),0,12) as Resolved_Date"
+ " from Hr_complaint_detail a,hr_complaint_status b where a.sys_complaint_id=b.Complaint_id and b.Resolved_or_not=1 and a.Emp_id="+empid, con);
DataSet ds = new DataSet();//Get the start Record Count //Remember database count is zero based so first decrease the value of //the current page int startRecord = (int.Parse(CurrentPage.Value) - 1) \* int.Parse(PageSize.Value); //Fetch only the necessary records. da.Fill(ds, startRecord, int.Parse(PageSize.Value), "hr\_complaint\_status"); //DataBind the Repeater Rep\_comp\_solved.DataSource = ds.Tables\["hr\_complaint\_status"\].DefaultView; Rep\_comp\_solved.DataBind(); if (ds.Tables\["hr\_complaint\_status"\].Rows.Count <= 0) { Rep\_comp\_solved.Visible = false; s = "No solved Complaints are there"; CreateMessageAlert(this, s); Prev.Visible = false; Next.Visible = false; } else { Prev.Visible = true; Next.Visible = true; } //Second Part //Create a new Command to select the total number of records SqlCommand Cmd = new SqlCommand("select
-
instead of footer you can place 2 link buttons bellow repeater the code goes like this
public void Repeaterfill()
{
SqlDataAdapter da = new SqlDataAdapter("select a.Complaint_id,a.Emp_id,a.Decription,"
+ " substring(Convert(varchar,a.Problem_date),0,12) as Problem_date,substring(Convert(varchar,b.Resolved_Date),0,12) as Resolved_Date"
+ " from Hr_complaint_detail a,hr_complaint_status b where a.sys_complaint_id=b.Complaint_id and b.Resolved_or_not=1 and a.Emp_id="+empid, con);
DataSet ds = new DataSet();//Get the start Record Count //Remember database count is zero based so first decrease the value of //the current page int startRecord = (int.Parse(CurrentPage.Value) - 1) \* int.Parse(PageSize.Value); //Fetch only the necessary records. da.Fill(ds, startRecord, int.Parse(PageSize.Value), "hr\_complaint\_status"); //DataBind the Repeater Rep\_comp\_solved.DataSource = ds.Tables\["hr\_complaint\_status"\].DefaultView; Rep\_comp\_solved.DataBind(); if (ds.Tables\["hr\_complaint\_status"\].Rows.Count <= 0) { Rep\_comp\_solved.Visible = false; s = "No solved Complaints are there"; CreateMessageAlert(this, s); Prev.Visible = false; Next.Visible = false; } else { Prev.Visible = true; Next.Visible = true; } //Second Part //Create a new Command to select the total number of records SqlCommand Cmd = new SqlCommand("select