﻿<?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 - Adding Template fields dynamically at Grid_InitializeRow event</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Adding-Template-fields-dynamically-at-GridInitializeRow-event/</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>Adding Template fields dynamically at Grid_InitializeRow event</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Adding-Template-fields-dynamically-at-GridInitializeRow-event/</link><pubDate>Wed, 14 Oct 2009 01:08:57 GMT</pubDate><dc:creator>foysal</dc:creator><description>&lt;blockquote&gt;I think use template type is not the best way. Why don't you use 'Hyperlink' type? For $ format, you can set on DataFormatString propery. With these way, it should be easier.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;e.g WebGrid1.RootTable.Columns.GetNamedItem("Price").DataFormatString = "$##.##";&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;Regards,&lt;br /&gt;Handy&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your reply. My situation is different. So,  thats not the way my boss wants. Anyway, I solved the problem using custom column type and WebControl calss.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks once again.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Adding Template fields dynamically at Grid_InitializeRow event</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Adding-Template-fields-dynamically-at-GridInitializeRow-event/</link><pubDate>Tue, 13 Oct 2009 03:28:18 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>I think use template type is not the best way. Why don't you use 'Hyperlink' type? For $ format, you can set on DataFormatString propery. With these way, it should be easier.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;e.g  WebGrid1.RootTable.Columns.GetNamedItem("Price").DataFormatString = "$##.##";&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Regards,&lt;br /&gt;Handy&lt;/div&gt;&lt;/div&gt;</description></item><item><title>Adding Template fields dynamically at Grid_InitializeRow event</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Adding-Template-fields-dynamically-at-GridInitializeRow-event/</link><pubDate>Mon, 12 Oct 2009 05:52:57 GMT</pubDate><dc:creator>foysal</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I want to modify a cell value at runtime. Suppose I have column which shows the price of a product and link that will open details of that product as popup. It will be exactly as follows:&lt;/p&gt;
&lt;p&gt;$9.99 &lt;a target="_blank" href="http://www.google.com/"&gt;Detail &lt;br /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Internal code will look like:&lt;/p&gt;&lt;pre&gt;$9.99&amp;nbsp;&amp;lt;a href='#' onclick='javascript:popUpWindow();'&amp;gt;Details&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I want to do this task in Grid_InitializeRow event. Something like bellow:&lt;/p&gt;&lt;pre&gt;if(e.Row.Type == RowType.Record)&lt;br /&gt;{&lt;br /&gt;   if(e.Row.Cells.GetNamedItem("Price") != null)&lt;br /&gt;   {&lt;br /&gt;      e.Row.Cells.GetNamedItem("Price").Column.ColumnType = ColumnType.Template;&lt;br /&gt;&lt;br /&gt;     //I want to set my text and link values from here.&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;I have tried some ways but unable to add anything in this cell. How can I do it? Expecting some working code from anyone.&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;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>