与detailsview的Hashtable绑定。 [英] Hashtable binding with detailsview.

查看:55
本文介绍了与detailsview的Hashtable绑定。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


i有一个哈希表,我已经接受了详情...这很好。


但是我不知道代码是什么我应该立即使用在我的详细信息视图中的标签上显示该哈希列表的值。

Hi all,

i have a hashtable which i have bounded to detailsview.. it is fine.

but i donno what code should i use now to display the values of that hashlist on labels in my details view.

展开 | 选择 | Wrap | 行号

推荐答案

你好bineetbindal,

我试着把一个detailsview绑定到一个哈希表。但这没效果。它引发了以下错误:

具有iddvwTest的DetailsView没有任何属性或属性可用于生成字段。确保您的数据源包含内容。


这意味着哈希表是不可绑定的数据源。我想一个解决方法是创建一个数据表,其中hashtable-keys为列,hashtable-values为列值。然后将gridview或detailsview绑定到此数据表。


但我很想知道您是否已成功将detailsview绑定到哈希表。等待你的回复,谢谢。
Hi bineetbindal,
I tried myself to bind a detailsview to a hashtable. But this did not work. It threw the following error:

DetailsView with id ''dvwTest'' did not have any properties or attributes from which to generate fields. Ensure that your data source has content.

This means hashtable is non-bindable datasource. I guess one work around would be to create a datatable with hashtable-keys as columns and hashtable-values as column-values. And then bind the gridview or detailsview to this datatable.

But I am keen to know if you have succeeded to bind the detailsview to the hashtable. Waiting your response, thanks.


HI,


我尝试了很多,但我无法做到,实际上我正在研究asp .net几年后,你能给我一些关于我如何用数据表做的代码吗?


实际上我面临的困难是 - 我有一个gridview。当一个人点击gridview时。我必须在详细信息视图中的标签上显示该行的所有值(这些标签位于详细信息视图中的tempalte列中)。我可以使用下面的代码执行此操作。直到时间详情视图在insertmode中。



I tried a lot but i was not able to do it, actually i am working on asp.net after few years, can you give me some code about how can i do it with datatable?

actually the difficulty i am facing is --- i have a gridview. when a person clicks on the gridview. i have to display all the values of that row on the lables in details view(those labels are in tempalte column in detailsview). i am able to do that with the code below. till the time detailsview is in insertmode.


展开 | 选择 | Wrap | 行号


你检查了 DetailsView类

有一些例子说明如何使用带有SqlDataSource的DetailsView作为它的源(连接到数据库)。
Have you checked out the DetailsView class on MSDN?
There are some examples there on how to use the DetailsView with a SqlDataSource as it''s source (which connects to a database).


这篇关于与detailsview的Hashtable绑定。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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