在DataGridView中显示Xml字符串 [英] Display an Xml String in DataGridView

查看:88
本文介绍了在DataGridView中显示Xml字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我将解释Xml的功能,但对于DataGridView,我没有代码,因为我似乎无法弄清楚问题所在.我从网址 http://www.someurl.com [

First I will explain what I have as far as the Xml but as for the DataGridView I have no code as i can''t seem to figure out the problem. I download source code from a web url http://www.someurl.com[^]. I then extract the links from the code and convert the list of links into an XML string. Now I have the XML but can''t figure out how to write the XML to the DataGridView any help would be appreciated and I hope my question was thorough enough to understand.

推荐答案

这听起来像您有一个层次深的XML,其中只有URL在第1级.
What it sounds like you have one level deep XML where only URLs are there at level 1. Somthing like:
<RssItems>
  <RssUrl>someUrl1</RssUrl>
  <RssUrl>someUrl2</RssUrl>
  <RssUrl>someUrl3</RssUrl>
  <RssUrl>someUrl4</RssUrl>
  ....
  <RssUrl>someUrln</RssUrl>
<RssItems>


只需使用此XML即可将其转换为数据集.
很少有相关链接:
从XML(ADO.NET)加载数据集 [ ^ ]
DataSet.ReadXml方法(XmlReader) [


Just use this XML to convert into a Dataset.
Few links for it: Loading a DataSet from XML (ADO.NET)[^]
DataSet.ReadXml Method (XmlReader)[^]

Once you have dataset with you, just bind it to the grid. You can make datagrid columns like hyperlink at designtime. Try!


这篇关于在DataGridView中显示Xml字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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