How to load an image into DataView

Good afternoon,
how can I load an image into dataview?
Unfortunately I don’t find any demo on how to load an image.
My following code does NOT work:

<script src="../dhtmlx/dhtmlxDataView/codebase/dhtmlxdataview.js" type="text/javascript"></script>
<link rel="STYLESHEET" type="text/css" href="../dhtmlx/dhtmlxDataView/codebase/dhtmlxdataview.css">
  var view;
  function doOnLoad(){
	view = new dhtmlXDataView({
	  template:"<img src='Images/AddressCompany128.png'>"
	view.load("XMLFiles/Test.xml", "xml");

with the Test.xml:

Please point me into the right direction.
I don’t really understand the template system behind the data loading.

Thank you in advance.
Best regards
Juergen Heyn, Wilhelmshaven, Germany


If the image path is defined in the “img” property of Dataview items, the template could be like so:

view = new dhtmlXDataView({
view.load(“XMLFiles/Test.xml”, “xml”);

Here is the example of “Test.xml”:


Template is either a string or a function that defines how items of Dataview will be rendered. The template is applied to each item. In case of string template, you need to set properties names between # #. When an item is rendered, the property value of an item will be set instead of #…#.

Dear Alexandra,

thank you very much for the quick reply.
Now I understand the logic behind the templates.

Best regards

the following are my demo codes on how to load an image, hope it helps you.
private void button1_Click(object sender, EventArgs e)
string fileName = “c:/Sample.png”;

        REImage reImage = REFile.OpenImageFile(fileName);

        REFile.SaveImageFile(reImage, "c:/reimage.png", new PNGEncoder());

more related codes can be found in this image application website.