---
title: "DataRepeater Control in C#.Net"  
description: "The DataRepeater control allows you to display rows of your data in a scrollable container giving you more flexibility and customization than standard"  
author: "Pushpendra Singh"  
published: 2011-01-24  
updated: 2020-08-23  
canonical: https://www.mindstick.com/articles/424/datarepeater-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# DataRepeater Control in C#.Net

The DataRepeater control allows you to display rows of your data in a scrollable container giving you more flexibility and customization than standard grid controls.\

## How to use DataRepeater

Drag and drop DataRepeater control from toolbox on the window form.

![DataRepeater Control in C#.Net](https://www.mindstick.com/mindstickarticle/de1a3efe-25f4-4fb6-a48b-2c35d052475d/images/999f344a-9b1c-454c-bba9-8cc3559efc5c.png)

Drag and drop textbox in the DataRepeater Control to display data.

![DataRepeater Control in C#.Net](https://www.mindstick.com/mindstickarticle/de1a3efe-25f4-4fb6-a48b-2c35d052475d/images/63a62f00-7d5a-4b17-8ab7-459723ad6097.png)

## BindData in DataRepeater

**Code:**

```
using System;using System.Data;using System.Data.SqlClient;using System.Text;using System.Windows.Forms; namespace WindowsFormsApplication1{     public partial class frmDataRepeater : Form    {         public frmDataRepeater()         {            InitializeComponent();         }      private void frmDataRepeater_Load(object sender, EventArgs e)         {            //Connect to the Database        string constring = "Server=(local);Database=my; User Id=sa; Password=sa";            SqlConnection sqlcon = new SqlConnection(constring);            //Open the connection            sqlcon.Open();            SqlCommand cmd = new SqlCommand();            SqlDataAdapter da = new SqlDataAdapter();            // Write the query            cmd.CommandText = "select * from regform";            da.SelectCommand = cmd;            cmd.Connection = sqlcon;            da.SelectCommand = cmd;            //create a dataset            DataSet ds = new DataSet();            da.Fill(ds);            //Close the connection            sqlcon.Close();            // Bind data to TextBox            textBox1.DataBindings.Add("Text", da, "id");            textBox2.DataBindings.Add("Text", da, "pass");            textBox3.DataBindings.Add("Text", da, "name");            dataRepeater1.Visible = true;            dataRepeater1.DataSource = ds.Tables[0];         }    }}
```

Data will bind to the DataRepeater when application run.

## Run the project

![DataRepeater Control in C#.Net](https://www.mindstick.com/mindstickarticle/de1a3efe-25f4-4fb6-a48b-2c35d052475d/images/1d6701f7-c40f-450e-b560-9999b470ee8a.png)

You can see next data by making scroll bar down.

![DataRepeater Control in C#.Net](https://www.mindstick.com/mindstickarticle/de1a3efe-25f4-4fb6-a48b-2c35d052475d/images/f00d742f-9954-449c-8bad-f8c0d9f790af.png)

---

Original Source: https://www.mindstick.com/articles/424/datarepeater-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
