locked
why repeater control is not showing data? RRS feed

  • Question

  • User963506563 posted

     I am using repeater control. When I set the data source and bind the control, it does not show any rows and columns. While the tables has two columns and two rows. There is no problem in datatables because when I bind them with grid view the 2 rows and the 2 columns are shown in the grid view.

    Whats the problem with repeater. 

    Wednesday, August 20, 2008 5:16 PM

Answers

  • User-1046570768 posted

    Hi azharrahi ,

                         While using DataRepeater giving data source and binding the control is not enough for displaying records. Explicitly we need to mention the binded column names according to database table column names with each column of the DataRepeater.

                          Check wheather you are binding the right column or not?

                           

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 21, 2008 12:51 AM
  • User-1034726716 posted


     I am using repeater control. When I set the data source and bind the control, it does not show any rows and columns. While the tables has two columns and two rows. There is no problem in datatables because when I bind them with grid view the 2 rows and the 2 columns are shown in the grid view.

    You need to bind your repeater manually since repeater control doesn't have a BoundFields or an attribute AutoGenerateColumns as what GridView has...

    Refer below for more information

    http://www.codersource.net/asp_net_repeater_databind.html

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 21, 2008 12:54 AM

All replies

  • User-305336156 posted

    You have to remember that the repeater control does not do anything for you automatically, except iterate through the data source. IOW is up to you to render the data for each row trough the templates.

    Wednesday, August 20, 2008 7:14 PM
  • User-1046570768 posted

    Hi azharrahi ,

                         While using DataRepeater giving data source and binding the control is not enough for displaying records. Explicitly we need to mention the binded column names according to database table column names with each column of the DataRepeater.

                          Check wheather you are binding the right column or not?

                           

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 21, 2008 12:51 AM
  • User-1034726716 posted


     I am using repeater control. When I set the data source and bind the control, it does not show any rows and columns. While the tables has two columns and two rows. There is no problem in datatables because when I bind them with grid view the 2 rows and the 2 columns are shown in the grid view.

    You need to bind your repeater manually since repeater control doesn't have a BoundFields or an attribute AutoGenerateColumns as what GridView has...

    Refer below for more information

    http://www.codersource.net/asp_net_repeater_databind.html

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 21, 2008 12:54 AM
  • User1934842847 posted

    write your source code of repeater control.

    so i can tell where you are wrong.

    Thursday, August 21, 2008 3:16 AM