Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. custom repeator with previous next button added at footer

custom repeator with previous next button added at footer

Scheduled Pinned Locked Moved ASP.NET
dockerhelp
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _tasleem
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • _ _tasleem

      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

      L Offline
      L Offline
      Learning IT
      wrote on last edited by
      #2

      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
      
      _ 1 Reply Last reply
      0
      • L Learning IT

        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
        
        _ Offline
        _ Offline
        _tasleem
        wrote on last edited by
        #3

        i am making a custom repeator, not using them in webpages

        Regards. Tasleem Arif

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups