﻿<?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 - New Row not using Columns[i].CellTemplate</title><link>http://www.intersoftsolutions.com/Community/WebGrid/New-Row-not-using-ColumnsiCellTemplate/</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>New Row not using Columns[i].CellTemplate</title><link>http://www.intersoftsolutions.com/Community/WebGrid/New-Row-not-using-ColumnsiCellTemplate/</link><pubDate>Wed, 19 May 2010 11:17:25 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><category>CellTemplate NewRow</category><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi David,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Attached is a simple sample using Northwind database under your scenario. However, in here, I have created a class object which created a check box object.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; So before you run the project, please ensure to copy the .cs file into app_code folder in your project. I hope it helps. Thank you and have a nice day.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;</description></item><item><title>New Row not using Columns[i].CellTemplate</title><link>http://www.intersoftsolutions.com/Community/WebGrid/New-Row-not-using-ColumnsiCellTemplate/</link><pubDate>Wed, 19 May 2010 08:30:49 GMT</pubDate><dc:creator>TimeBandit</dc:creator><category>CellTemplate NewRow</category><description>&lt;p&gt;Attached is a screen shot of the results. &lt;/p&gt;</description></item><item><title>New Row not using Columns[i].CellTemplate</title><link>http://www.intersoftsolutions.com/Community/WebGrid/New-Row-not-using-ColumnsiCellTemplate/</link><pubDate>Wed, 19 May 2010 08:08:41 GMT</pubDate><dc:creator>TimeBandit</dc:creator><category>CellTemplate NewRow</category><description>&lt;p&gt;Yudi,&lt;/p&gt;
&lt;p&gt;I am setting &lt;/p&gt;&lt;span style="font-size: 13px"&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="font-size: 13px"&gt;&lt;/span&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;BooleanEditTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; bt = &lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;BooleanEditTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;();&lt;p&gt;bt.ColumnName = ColumnName;&lt;/p&gt;&lt;p&gt;bt.KeyColumnName = KeyColumn;&lt;/p&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;.RootTable.Columns[iColIdx].CellTemplate = bt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;.RootTable.Columns[iColIdx].NewRowEditType = &lt;/span&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;NewRowEditType&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;.SameAsEditType;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

&lt;p&gt;I neglected to mention that. &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px"&gt;Why doesn't it work?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px"&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px"&gt;David Parkin&lt;/span&gt;&lt;/p&gt;</description></item><item><title>New Row not using Columns[i].CellTemplate</title><link>http://www.intersoftsolutions.com/Community/WebGrid/New-Row-not-using-ColumnsiCellTemplate/</link><pubDate>Wed, 19 May 2010 02:33:30 GMT</pubDate><dc:creator>yudi</dc:creator><category>CellTemplate NewRow</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;In current build of WebGrid 7, it is possible to add ASP.NET server controls to the WebGridCell using &lt;em&gt;Template Column Type&lt;/em&gt;. When using the Template Column Type, you can put any server side controls inside the &lt;em&gt;CellTemplate&lt;/em&gt; property of the &lt;em&gt;WebGridColumn&lt;/em&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Editing (means, both edit or add new row) is not affected with Templated Column. In order to have custom edit type, you can use your favorite editing control and “hook” it up into WebGrid. This great and powerful feature will allow you to use virtually any types of controls as WebGrid’s EditType, whether it is an ASP.NET Server Control or a DHTML Client Control.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;For more detail information about this ‘Custom Editor Open Architecture’, please check on WebGrid’s documentation in ‘Custom Editor Open Architecture’ topic.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Once the custom edit type is implemented, you can simply set the value of ‘NewRowEditType’ property to “SameAsEditType” in order to have WebGrid uses custom edit type both on in-line editing or add-new row.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>New Row not using Columns[i].CellTemplate</title><link>http://www.intersoftsolutions.com/Community/WebGrid/New-Row-not-using-ColumnsiCellTemplate/</link><pubDate>Tue, 18 May 2010 11:27:17 GMT</pubDate><dc:creator>TimeBandit</dc:creator><category>CellTemplate NewRow</category><description>&lt;p&gt;I'm using the &lt;span style="font-size: 13px"&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 13px"&gt;&lt;span style="color: #a31515; font-size: 13px"&gt;LayoutSettings 
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;&lt;/span&gt;&lt;span style="color: #ff0000; font-size: 13px"&gt;&lt;span style="color: #ff0000; font-size: 13px"&gt;AllowAddNew&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;="Yes"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; &lt;/span&gt;

&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px"&gt;and, a template for a column:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;span style="font-size: 13px"&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;.RootTable.Columns[iColIdx].ColumnType = ISNet.WebUI.WebGrid.&lt;/span&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;ColumnType&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;.Template; &lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;.RootTable.Columns[iColIdx].EditType = &lt;/span&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;EditType&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;.Checkbox; &lt;/span&gt;&lt;span style="font-size: 13px"&gt;&lt;span style="font-size: 13px"&gt;
&lt;/span&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;BooleanEditTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; bt = &lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;&lt;span style="color: #2b91af; font-size: 13px"&gt;BooleanEditTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;(); 

&lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;.RootTable.Columns[iColIdx].CellTemplate = bt;&lt;/span&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 13px"&gt;This works great for all the rows in the grid, except the New Row. The New Row (at the top of the grid) doesn't load the template. It defaults to the standard checkbox. How do I get the New Row to use the template?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;regards,&lt;/p&gt;&lt;p&gt;David Parkin&lt;span style="font-size: 13px"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;</description></item></channel></rss>