调用ItemDataBound时如何删除转发器中的行 [英] how to delete row in repeater when ItemDataBound is call

查看:78
本文介绍了调用ItemDataBound时如何删除转发器中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



嘿,你好吗?我在转发器中有一个问题,当我填充转发器时,我不会有一些行,所以我怎么能删除这些行?



一个重要的事情是我想删除这些行不想隐形。请告诉我这个事件中的删除行。



ie:

< pre lang =c#> protected void rptData_ItemDataBound( object sender,RepeaterItemEventArgs e)
{

if int num > 3
{
row delete;
}
其他
{
行显示
}
}



朋友我被困在这么快回答我.....

解决方案

HI,



您可以通过在那里执行数据库连接和数据库操作来删除网格中的行。



  void  Repeater_ItemCommand( Object  Sender,RepeaterCommandEventArgs e){
if (e.CommandName == 删除){
int id = e.CommandArgument.ToString()。Numeric();

db.SPs.SpDeleteAccount(id).Execute();
// 代码的其余部分
}
}





请参阅此链接。

从ASP.NET Repeater项删除 - 错误删除





谢谢


Hello,

hey all how are you? i have one problem in repeater when i have fill the repeater than i don''t wont some rows so how can i delete this rows?

one important thing is i want to delete this rows don''t want to invisible.so tell me about delete rows in this event.

i.e:

protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {

               if(int num > 3)
               {
                  row delete;
               }
               else
               {
                  row display
               }
         }


friends i''m stuck in this so quick answer me.....

解决方案

HI,

You can delete the row from the grid by performing the database connectivity and database operation there.

void Repeater_ItemCommand(Object Sender, RepeaterCommandEventArgs e) {        
    if( e.CommandName == "Delete" ) {
        int id = e.CommandArgument.ToString().Numeric();

        db.SPs.SpDeleteAccount(id).Execute();
        // the rest of your code
    }
} 



Refer this link.
Deleting from ASP.NET Repeater item - erroneous deleting


Thanks


这篇关于调用ItemDataBound时如何删除转发器中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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