如何动态刷新的.NET数据绑定Repeater控件 [英] How to dynamically refresh a .NET databound repeater control

查看:527
本文介绍了如何动态刷新的.NET数据绑定Repeater控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 .NET转发控件是数据绑定到列表中。由于直放站的项目集合的一部分,我有一个删除按钮,有效地消除这个当前列表元素。

I have a .NET repeater control that is data-bound to a List. As part of the Repeater's Item Collection, I have a "Remove Button" that effectively removes this current List element.

这工作,在code-的背后,我能成功地从数据源的删除一个项目的转发的。

This works, in code-behind I can successfully remove an item from the datasource of the Repeater.

我的问题是这样的:当我重新更新数据源并调用 MyRepeater.DataBind()再次,在转发的接口不与该项目刷新删除。

My problem is this : when I reset the updated datasource and call MyRepeater.DataBind() again, the Repeater interface does not refresh with the Item removed.

我要寻找的事件基本上重画或刷新的转发的基础上,更新列表。感谢任何指针或示例。

I am looking for the event to essentially redraw or refresh the Repeater based on the updated List. Thanks for any pointers or examples.

推荐答案

您需要调用'的DataBind'的方法在你的数据源,然后的叫'的DataBind'您的Repeater控件。

You need to call the 'DataBind' method on your datasource, then call 'DataBind' on your Repeater control.

这篇关于如何动态刷新的.NET数据绑定Repeater控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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