开发者

showing a xml file contents in a dbctrlgrid

I have a win application project that should be done in delphi2010.

In a form something like the image 开发者_运维知识库below,should be produced:

showing a xml file contents in a dbctrlgrid

www.up.iranblog.com/Files2/1e867ce0de784c469496.jpg

First the image of product and under that tha name and the price.

The information should be read from a xml file, but I don't know how to display the information in dbctrlgrid?

Please help

thanx in advance


For DBCtrlGrid, it is just like a normal panel control. The difference is, it creates this panel for every record in your dataset. So you should put your data-aware or ordinary controls in the panel anyway you like, and your panel will be automatically repeated for each record in the dataset, and if the controls on your panel are data-aware, then they will receive data of the connected fields for each corresponding record. You can check DBCtrlGrid entry in Delphi help for more information.

If you want to use DBCtrlGrid for presenting your XML data, then you should first present your XML data as database records. To do so, you should first create a XML transformation file using XML Mapper tool. After that, you can use a XMLTransformProvider control, and connect it to your transformation file, and your XML data. XMLTransformProvider would transform your XML data to database records using the provided transformation file.

Now you can connect a ClientDataset to your XMLTransformProvider, and your XML data would be available in your ClientDataset as database records. You can connect a DataSource to your ClientDataset, and connect your DBCtrlGrid to that datasource, so that your DBCtrlGrid control would present the data available in ClientDataset.

So the data flow is somehow like this:

XML Data -- (Transformed to database records) --> Data Provider --> ClientDataset --> DataSource --> Data-aware controls (e.g. DBCtrlGrid).

P.S. From your provided link, it seems you are located in Iran. The included links cannot be accessed from an IP located in Iran, so the web pages won't load. You can read the same documentation from Delphi's installed help files. Just drop each component on the form, and press F1.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜