在asp.net中将datagridview与treeview绑定 [英] Bind datagridview with treeview in asp.net

查看:59
本文介绍了在asp.net中将datagridview与treeview绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个树状视图,我将其与myfile系统绑定,但我想将datagridview与该树状视图绑定,以在gridview中显示目录文件...任何人都可以帮助我将datagridview与树状视图绑定吗?提前谢谢...

I have a treeview and i binded it with myfile system, mow i want to bind datagridview with this treeview to display directory files in gridview... can any one help me out to bind datagridview with treeview??? thanx in advance...

推荐答案



对与树视图绑定并将其绑定到网格视图的数据源进行类型转换.

例如,如果您使用数据集绑定树视图,则可以执行以下操作

DataSet ds =(Dataset)treeview.datasource/datacontext;

gridview.datasource = ds;
gridview.databind();

希望这会有所帮助....


Type cast your datasource with which you have binded the tree view and bind it to the grid view.

for example if u r using dataset for binding the treeview you can do as follows

DataSet ds=(Dataset)treeview.datasource/datacontext;

gridview.datasource=ds;
gridview.databind();

Hope this helps....


这篇关于在asp.net中将datagridview与treeview绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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