﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebDesktop - image on grid using javascript</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/image-on-grid-using-javascript/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>image on grid using javascript</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/image-on-grid-using-javascript/</link><pubDate>Sun, 01 Aug 2010 23:54:35 GMT</pubDate><dc:creator>niven</dc:creator><description>&lt;p&gt;Hi Ca,&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I have replicate a sample based on your scenario.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font class="Apple-style-span" style="font-family: 'lucida sans unicode', sans-serif; "&gt;&lt;span style="line-height: 14px; " /&gt;&lt;/font&gt;&lt;/p&gt;&lt;font class="Apple-style-span" style="font-family: 'lucida sans unicode', sans-serif; "&gt;&lt;p class="MsoNormal"&gt;Below is part of the code which i wrote for your sample.&lt;/p&gt;&lt;p class="MsoNormal" /&gt;&lt;pre&gt;var BasedOn1 = WebGrid1.RootTable.GetRow(0).GetCells()[1];
var row1 = WebGrid1.RootTable.GetRow(0);
var cell1 = row1.GetCells()[0].CellElement.childNodes[0];
if (BasedOn1.Text == 1) {
                cell1.setAttribute("src", "./images/steven.jpg", true);
            }&lt;/pre&gt;&lt;p&gt;The image(&lt;b&gt;cell1&lt;/b&gt;) will be change based on the EmployeeID(&lt;b&gt;BasedOn1&lt;/b&gt;).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p /&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGridColumn Caption="Image" Name="Image" CellImage=".\images\anne.jpg"
                        Width="100px" ColumnType="Image" EditType="NoEdit"&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;span style="font-family: 'lucida sans unicode'; "&gt;Please keep that in mind, you have to declare an images first on WebGrid using a &lt;b&gt;CellImage &lt;/b&gt;Tag or the src will not be shown on client side.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" style="font-family: 'lucida sans unicode'; "&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" style="font-family: 'lucida sans unicode'; "&gt;Hope this one can resolve you issue.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" style="font-family: 'lucida sans unicode'; "&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" style="font-family: 'lucida sans unicode'; "&gt;Best regards,&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" style="font-family: 'lucida sans unicode'; "&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" style="font-family: 'lucida sans unicode'; "&gt;Niven Prasetya&lt;/font&gt;&lt;/p&gt;&lt;p /&gt;&lt;/font&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>image on grid using javascript</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/image-on-grid-using-javascript/</link><pubDate>Sun, 01 Aug 2010 02:18:49 GMT</pubDate><dc:creator>ismail</dc:creator><description>&lt;p&gt;thank you for reply,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;My scenario is little different from the example you have given.&lt;/p&gt;
&lt;p&gt;I have to setup image on the column at the time of loading the page. and image should be dynamic depending on the value of the some column. For example i am using the image on the first column and these image depending on the value on the second. if second column contains value pdf , then first column shows pdf.jpg . if second column contains doc, then first column contains doc.jpg. And all these should be come at the time of page loading not in any button click. and from the front end.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thanks nad regards&lt;/p&gt;
&lt;p&gt;ca &lt;/p&gt;</description></item><item><title>image on grid using javascript</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/image-on-grid-using-javascript/</link><pubDate>Thu, 29 Jul 2010 03:24:28 GMT</pubDate><dc:creator>niven</dc:creator><description>&lt;p&gt;Hi CA,&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I have attached a simple sample of your scenario.&lt;/p&gt;
&lt;p&gt;im using a button as a trigger to change the image on Images column.&lt;/p&gt;
&lt;p&gt;Im using GetSelectedObject on my sample, so the image wont change until you select a row then hit the button.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Hope this can resolve your issue.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Niven Prasetya.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>image on grid using javascript</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/image-on-grid-using-javascript/</link><pubDate>Wed, 28 Jul 2010 09:31:11 GMT</pubDate><dc:creator>ismail</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;i would like to setup a grid. In which one column contains the image depending on the value in the next column. I know , how to do this from the backend. Can you please tell me , how can i do this from the javascript.&lt;/p&gt;
&lt;p&gt;if possible , please send one example or link to example&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thanks and regards&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;ca&lt;/p&gt;</description></item></channel></rss>