Click here to Skip to main content
15,891,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

i'm working on repeaters, where i have bind it already.

but i want to add some more empty rows to the repeater.

suppose after binding if there are 6 rows, i want to make
it 10 rows[4 empty rows].

after binding the data to the repeater, the rows will be.. 4 or 5 or 6 or 1 or 2 or not known,
i want to make it as default to 10 rows, so that it look good, all the time.

using c#.

is it possible.

if yes, plz let me know

Thanks
Posted
Updated 13-Aug-14 6:49am
v2

The only thing you can do in a binding situation is to add empty rows to the data source you bound the repeater to.

By "empty rows", I mean each value in the row must be appropriate to that field to represent an empty row. You can't just add null as the row and expect it to row. The row must contain a full set of values for the row.
 
Share this answer
 
You can do it via client-side scripting.
For example:
Assumed you have this:
HTML
<table id="myTable">
  <tbody>
    <tr>...</tr>
    <tr>...</tr>
  </tbody>
</table>

You can add some more rows to this table like this (using jquery)
JavaScript
$('#myTable tr:last').after('<tr>...</tr><tr>...</tr>');
 
Share this answer
 
v2
Comments
abdul subhan mohammed 13-Aug-14 12:44pm    
using c#, plzz
abdul subhan mohammed 13-Aug-14 12:47pm    
actually, when i bind the data, it will be(rows) 5 or 6 or 7 or some time 1 or 2... but i want to make it the exact/default rows like 10.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900