c# - DataGridView with images from XML file -


say store image paths in xml file. want display image in datagridview depending on status stored in sql server database table. therefore, if add new project, store 'in progress' in project table under status. display progress.png in datagridview. likewise, if change status in progress completed, want display complete.png. working 2 images, let me know best way go around doing be. sample code appreciated. thanks.

<?xml version="1.0" encoding="utf-8" standalone="yes"?> <images> <pic>     <image>images/progress.png</image>     <caption>in progress</caption> </pic> <pic>     <image>images/complete.png</image>     <caption>completed</caption> </pic> </images> 

use lambada expressions match conditions xml file , sql database. here sample walk through.

var imagelist = imagelist.where(x => x.status ==status).firstordefault().tolist(); 

where imagelist list of images populated xml file. , status set of status sql database.

add image filename in dataset or datasource use power gridview.

in tag of grid view add code

 <asp:image id="image1" runat="server" imageurl="../images/'<%# eval("filename") %>'" width="100px" height="100px" /> 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -