以编程方式更改C#datalist项目 [英] Changing C# datalist item programmatically

查看:110
本文介绍了以编程方式更改C#datalist项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个datalist我想以编程方式运行一些检查,然后更改显示的文本。这可以做吗任何示例?

解决方案

您可以对datalist控件的数据源(数据,收集等)进行计算和检查)。此外,您可以通过更新数据库的数据源以编程方式更改数据表显示的项目的值。



另一种方法是使用ItemDataBound事件。 在MSDN中的您可以看到一个例子。


I have a datalist i want to programmatically run some checks and then change the text that is been displayed. Can this be done ? Any examples?

解决方案

You can do your calculations and checks on datalist control's data source (datatable, collection, ... etc.). Also you can programmatically change the values of the items that datalist display by updating the datasource of the datalist.

An alternative way is using ItemDataBound event. Here in MSDN you can see an example.

这篇关于以编程方式更改C#datalist项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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