﻿<?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 - WebGrid Enterprise - Add link in webgrid base on the cell value</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Add-link-in-webgrid-base-on-the-cell-value/</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>Add link in webgrid base on the cell value</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Add-link-in-webgrid-base-on-the-cell-value/</link><pubDate>Thu, 28 Jul 2011 10:21:32 GMT</pubDate><dc:creator>dwh168</dc:creator><description>&lt;p&gt;Thank you very much!&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;It works!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;David&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Add link in webgrid base on the cell value</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Add-link-in-webgrid-base-on-the-cell-value/</link><pubDate>Wed, 27 Jul 2011 22:47:39 GMT</pubDate><dc:creator>Riendy</dc:creator><description>&lt;p&gt;Hi David,&lt;br /&gt;&lt;br /&gt;Could you please let me know where the snippet code placed ?&lt;/p&gt;&lt;p&gt;If you want to add a link in WebGrid base on the cell value, I suggest you to add code on InitializeRow WebGrid event. Then you have to add HyperlinkDisplayText to define text which is shown and HyperlinkFormatString to define where will be navigated after you click the display text. For the example, please follow this code:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;        WebGrid1.RootTable.Columns[1].HyperlinkDisplayText = " &amp;lt;img alt='" &amp;#43; "?id=" &amp;#43; e.Row.Cel      ls[0].Text &amp;#43; "' src='" &amp;#43; e.Row.Cells[1].Text &amp;#43; "'/&amp;gt;";
        
        WebGrid1.RootTable.Columns[1].HyperlinkFormatString = e.Row.Cells[0].Text &amp;#43; ".aspx";&lt;/pre&gt;
&lt;p&gt;Hope this helps.&lt;br /&gt;Riendy&lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Add link in webgrid base on the cell value</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Add-link-in-webgrid-base-on-the-cell-value/</link><pubDate>Wed, 27 Jul 2011 11:56:56 GMT</pubDate><dc:creator>dwh168</dc:creator><description>&lt;p&gt;For example, this Webgrid looks like:&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;MA     100&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;CT      200&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;CA     300&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I want add link ONLY for MA and make the link,  like &amp;lt;a href="anotherpage.aspx?number=100"&amp;gt;MA&amp;lt;/a&amp;gt;&lt;/p&gt;
&lt;p&gt;And if the value of first column is not "MA", just display TEXT.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Can I do this?&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;David&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>