如何在c#中进行数据绑定后在转发器中添加空行 [英] how to add empty rows in a repeater after databinding in c#

查看:96
本文介绍了如何在c#中进行数据绑定后在转发器中添加空行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在使用中继器,我已经将它绑定了。



但我想在转发器中添加一些空行。



假设绑定后如果有6行,我想制作

它10行[4个空行]。



将数据绑定到转发器后,行将是.. 4或5或6或1或2或者不知道,

i想要默认为10行,所以它一直都很好看。



使用c# 。



是可能的。



如果是的话,请告诉我



谢谢

解决方案

在绑定情况下你唯一能做的就是向你绑定的数据源中添加空行转发器。



空行,我的意思是行中的每个值必须适合该字段才能表示空行。您不能只将null添加为行并期望它行。该行必须包含该行的一组完整值。


您可以通过客户端脚本执行此操作。

例如:

假设你有这个:

 <      id   =  myTable >  
< tbody >
< tr > ... < / tr >
< ; tr > ... < / tr >
< / tbody >
< / table >



你可以像这样在这个表中添加更多行(使用jquery)

 


' #myTable tr:last')。after(' < tr> ...< / tr>< tr> ...< / tr>');


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

解决方案

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.


You can do it via client-side scripting.
For example:
Assumed you have this:

<table id="myTable">
  <tbody>
    <tr>...</tr>
    <tr>...</tr>
  </tbody>
</table>


You can add some more rows to this table like this (using jquery)


('#myTable tr:last').after('<tr>...</tr><tr>...</tr>');


这篇关于如何在c#中进行数据绑定后在转发器中添加空行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆