将arraylist值绑定到标签数量 [英] binding arraylist values to number of labels

查看:71
本文介绍了将arraylist值绑定到标签数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数组列表中绑定了一些值
我的桌子上有一张桌子
带有标签的4列6行,每个td带有标签
我想将标签与来自arraylist的数据绑定
请提前帮助谢谢
asok

i have got some values binded in an array list
i have a table in my form
with 4 columns and 6 rows each td with a label
i want to bind a label with data from arraylist
please help thanks in advance
asok

推荐答案

当您说我的表格中的表格"时,它是带有单个标签控件的HTML表格还是在客户端上呈现为表格的gridview?

如果它是HTML表,则您已经具有标签ID,只需遍历arraylist并将其分配给标签文本即可.

如果它是在项目模板中带有标签的gridview,那么最好的方法是使用grids databinding事件将值分配给标签. 此页面 [ MSDN上的^ ]解释了有关gridview的onDataBinding事件.

HTH!
When you say "table in my form" is it a HTML table with individual label controls or a gridview that is getting rendered as a table on the client?

If it is a HTML table then you already have the label ids just loop through the arraylist and assign it to the label text.

If it is a gridview with labels in item template then the best way forward would be to use the grids databinding event to assign the values to the labels. This page[^] from MSDN explains about the gridview''s onDataBinding event.

HTH!


这篇关于将arraylist值绑定到标签数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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