﻿<?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 - WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</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>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Mon, 26 Oct 2009 11:24:36 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;Well, I have some good news.  While I was preparing for recording the problem I found that it has been fixed in the latest update.  I had run the Update Manager this morning and updated to the latest and whatever you guys did, fixed this issue.&lt;/p&gt;
&lt;p&gt;The assigned IDs to the Template controls are now synced up correctly AFTER the grid rows are retrieved as in the code below:&lt;/p&gt;&lt;span style="color: #0000ff; font-size: 9px"&gt;&lt;span style="color: #0000ff; font-size: 9px"&gt;&lt;pre&gt;foreach (ISNet.WebUI.WebGrid.WebGridRow row in oRows)
{
   iRows&amp;#43;&amp;#43;;
   ISNet.WebUI.WebGrid.WebGridCellTemplateContainer container = row.Cells[0].GetTemplateContainer();
   PrismCheckBox cb = (PrismCheckBox)container.FindControl(PRISMConstants.PrismGridView.EmbeddedCheckBoxId);
...&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #000000; font-size: 10pt"&gt;So now the initial assigned ID to the Template control is retrieved correctly, e.g., the cb object in the above code reflects the assigned ID.&amp;nbsp; So when the ids initially are 00, 03, 06, etc., then the Rows collection shows the cb.ClientID as 00, 03, 06 correctly rather than 00, 01, 02 incorrectly as it was doing earlier.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000; font-size: 13px"&gt;Now you can say it's resolved, but it was definitely a bug because it did not behave this way prior to the update I applied this morning.&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Mon, 26 Oct 2009 10:07:55 GMT</pubDate><dc:creator>technical@intersoftpt.com</dc:creator><description>&lt;p&gt;Flash videos would be great! Looking forward to it, thanks.&lt;/p&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Mon, 26 Oct 2009 10:04:52 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;You obviously do not understand what I have described in detail.  I NEVER said I wanted the same conrol ID or numbering for anything.  I just want the dang thing to work consistently like I've already described in detail.&lt;/p&gt;
&lt;p&gt;I made a point of stating the difference between when the page first renders and when it post back.  Please reread my detailed information slowly and get an understanding of the problem.  Your response obviously shows that you still do not understand the issue and I have no more to add to it than I already have.&lt;/p&gt;
&lt;p&gt;I'll see about recording a flash video of the issue being debugged since explaining seems to be too complicated.&lt;/p&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Mon, 26 Oct 2009 09:55:20 GMT</pubDate><dc:creator>technical@intersoftpt.com</dc:creator><description>&lt;p&gt;Yousif, I understand your point that you desire the numbering to be same within a row context. However, that is not the way how the template works. I believe the detailed information on how the template works is beyond our scope here -- the bottomline is, each cell has its own templated container, and thus each cell has its own ID, in such case, the ID is automatically generated by ASP.NET. Eg, ctl00 represents the container for CellA, while ctl01 represents the container for CellB.&lt;/p&gt;
&lt;p&gt;That said, your desire to have the same controlID for both CellA and CellB is simply not possible (referring to your first post) because as we understand how the template works thus far, each cell requires its own &lt;span style="text-decoration: underline"&gt;unique&lt;/span&gt; template container, and thus automatically resulting in different ID when rendered by ASP.NET.&lt;/p&gt;
&lt;p&gt;As such, I don't see where the inconsistent problem is, since the ID is properly incremented based on row-to-cell ordering. Again, the ID increment process has been discussed above and I hope you've understood it completely.&lt;/p&gt;
&lt;p&gt;Let me know if you have any questions or other feedback. Thank you.&lt;/p&gt;
&lt;p&gt;PS: If you're able to come up with a sample that shows the inconsistency issue which is based on the correct understanding on template process described above, please send over the sample and we'll be glad to investigate it for you.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Mon, 26 Oct 2009 09:46:19 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;Don't respond in a condescending manner and you'll get a polite response.  It's very frustrating on this end when you do not respond with helpful information aside from "well it works in our samples then it must be not be a bug" type of answer.&lt;/p&gt;
&lt;p&gt;We're running into real life usage of your product that are producing problems that are difficult to get over and we need your help.  So please try to understand my frustration with that type of response.  Thanks.&lt;/p&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Mon, 26 Oct 2009 08:39:52 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Based on TemplatedCell sample (included in WebGrid C# samples), the ControlID numbering worked fine in both first load and postback. The sample used two templated cells, and if you notice, the ID is &lt;span style="text-decoration: underline"&gt;consistently&lt;/span&gt; incremented based on the &lt;span style="text-decoration: underline"&gt;cell-to-row&lt;/span&gt; order. &lt;/p&gt;&lt;p&gt;As told earlier, the internal ID is maintaned automatically by ASP.NET, and the numbering sequence relies on when the template is actually created and added to the page collection. In this case, the templates are created on all cells in a row first, then the next row. &lt;/p&gt;&lt;p&gt;Thus, it's clear that this issue wasn't a bug, unless there's scenario where the ID is generated inconsistently. &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The problem is not resolved, and I'm still able to reproduce the inconsistent numbering issue.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Edited&amp;nbsp;10/26 per &lt;/em&gt;&lt;a href="http://www.intersoftpt.com/Community/ForumAgreement.aspx" target="_blank"&gt;&lt;em&gt;EULA&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, please respond politely and be constructive.]&lt;/em&gt;&lt;/p&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Sat, 24 Oct 2009 13:45:44 GMT</pubDate><dc:creator>technical@intersoftpt.com</dc:creator><description>&lt;p&gt;Based on TemplatedCell sample (included in WebGrid C# samples), the ControlID numbering worked fine in both first load and postback. The sample used two templated cells, and if you notice, the ID is &lt;span style="text-decoration:underline;"&gt;consistently&lt;/span&gt; incremented based on the &lt;span style="text-decoration:underline;"&gt;cell-to-row&lt;/span&gt; order. &lt;/p&gt;
&lt;p&gt;As told earlier, the internal ID is maintaned automatically by ASP.NET, and the numbering sequence relies on when the template is actually created and added to the page collection. In this case, the templates are created on all cells in a row first, then the next row. &lt;/p&gt;
&lt;p&gt;Thus, it's clear that this issue wasn't a bug, unless there's scenario where the ID is generated inconsistently. &lt;/p&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Fri, 23 Oct 2009 17:27:32 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;I've provided very detailed info in that you can easily create your own sample.  It should take you 5-10 minutes to duplicate this.&lt;/p&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Thu, 22 Oct 2009 00:22:28 GMT</pubDate><dc:creator>technical@intersoftpt.com</dc:creator><description>&lt;p&gt;Yousif,&lt;/p&gt;
&lt;p&gt;The ControlID is managed internally by ASP.NET Framework code, which is beyond the Grid's processing. However, if you can send us a working sample that reproduce the issue, we'll be happy to help you investigating the issue. And possibly make a fix on it if we can find a solid solution to the issue.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Tue, 20 Oct 2009 08:25:25 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;It's not so much what we do with the IDs, it's that they don't match against your row collection when retrieved from the grid.  Our custom embedded check box uses&lt;span style="font-size: 10pt"&gt; LoadPostData&amp;nbsp;&lt;/span&gt;to load it's checked/unchecked state.  Here, it sets the server-side Checked and SElectedKeyValue properties from the hidden fields containing their respective values that are posted back in the postCollection.  This part is handeled just fine even if the IDs are not in sequential order.&lt;/p&gt;
&lt;p&gt;The problem occurs when we retrieve the rows from the grid after the data is posted back from an initial page load where the IDs were not in sequence.  We call &lt;span style="font-size: 9px"&gt;&lt;span style="font-size: 10pt"&gt;oGrid.RootTable.Rows to get the rows collection.  We then iterate through it and get the check box control and check it's Checked property.  The problem is, when we find the row with Checked as true, the data for that row does NOT match what the user selected.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9px"&gt;&lt;span style="font-size: 13px"&gt;The Rows collection contains the rows in sequence rather than what they actually were assigned on the initial load of the page.  So if the page loaded with two Template columns, the check box would be assinged ctl00, ctl02, ctl04, etc.  If the user selects the check box in the 3rd row (ctl04), then the Rows collection would return the data for row 5 since ctl04 would be for control 5 if the controls were created sequentially.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9px"&gt;&lt;span style="font-size: 13px"&gt;You can easily duplicate this from all the info I've given you.  I've been able to do this with your grid with a simple check box.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9px"&gt;&lt;span style="font-size: 13px"&gt;I have a workaround in place for now but would prefer this work correctly since the workaround creates more overhead.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebGrid 7 Template Column Control ClientID Numbering Inconsistent</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7-Template-Column-Control-ClientID-Numbering-Inconsistent/</link><pubDate>Fri, 16 Oct 2009 09:47:25 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;We have a major problem that's cropped up and we need help as it's rendering our grids unusable.  Our grids are customized with the first column always a check box.  This is a Template column that hosts our own custom check box control.  The issue I'm about to describe only occurs when the page is loaded without a post back.  It works fine when it is a post back.&lt;/p&gt;
&lt;p&gt;Each embedded check box has the generic ID of PrismCheckBoxRowChecker.  The ClientID is something like ctl00_ctl00_WebPaneManager1_ViewLeftSide_Content_View_PrismGridViewControl_&lt;strong&gt;ctl00&lt;/strong&gt;_PrismCheckBoxRowChecker.&lt;/p&gt;
&lt;p&gt;The problem upon loading the grid without a post back is that the ClientID portion that is serialized, i.e., ctl00, ctl01, ctl02, etc. is inconsistent and makes no sense.  Some pages the initial page load would load fine and in order.  But on other pages it may load in increments of 2 or 3 or 4 and so on which I don't understand.  So the initial controls on the page may have the ctl00, ctl02, ctl04, ctl06, etc.  which would be fine if it stayed consistent on post back.  However, it does not.&lt;/p&gt;
&lt;p&gt;On post back, it works correctly every time, i.e., the controls are serialized correctly as ctl00, ctl01, ctl02, etc.  This creates a BIG problem because if the second row is checked and the page was rendered in, let's say, increments of 3, then the second control would be ctl03.  On post back, however, this id represents the fourth control and would then render the selected item useless because it doesn't match.  On some grids the initial load works just fine.&lt;/p&gt;
&lt;p&gt;In the InstantiateIn method of our ITemplate control, the check box is created and added to the container.Controls collection.  Below is an example of the container.Parent.Controls collection after the check box control is added via container.Controls.Add.&lt;/p&gt;
&lt;p&gt;After the first Add, here's what's in the container.Parent.Controls:&lt;br /&gt;&lt;strong&gt;ctl00_ctl00_WebPaneManager1_ViewLeftSide_Content_View_PrismGridViewCtl_ctl00&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After the second check box is added, here's what's there in addition to the line above:&lt;br /&gt;&lt;strong&gt;ctl00_ctl00_WebPaneManager1_ViewLeftSide_Content_View_PrismGridViewCtl_ctl00_PrismCheckBoxRowChecker&lt;br /&gt;ctl00_ctl00_WebPaneManager1_ViewLeftSide_Content_View_PrismGridViewCtl_ctl01&lt;br /&gt;ctl00_ctl00_WebPaneManager1_ViewLeftSide_Content_View_PrismGridViewCtl_ctl01_ctl00&lt;br /&gt;ctl00_ctl00_WebPaneManager1_ViewLeftSide_Content_View_PrismGridViewCtl_ctl02&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Why is this last control, ctl02, being added?  I'm wondering if there's a bug in the underlying WebGridCellTemplateContainer code?  This continues as the controls are added, i.e., after the third check box is added, the last controls is then:&lt;br /&gt;&lt;strong&gt;ctl00_ctl00_WebPaneManager1_ViewLeftSide_Content_View_PrismGridViewCtl_ctl04&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Please help.  Let me know what other information I can provide.&lt;/p&gt;
&lt;p&gt;[EDIT] I did try a standard check box, i.e., &lt;span style="font-size: 10pt"&gt;System.Web.UI.WebControls.&lt;span style="color: #2b91af"&gt;&lt;span style="color: #2b91af"&gt;CheckBox&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; and the behavior was the same by the way.  Our templated class is this:&lt;/p&gt;&lt;span style="font-size: 9px"&gt;&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;&lt;span style="color: #0000ff"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt;&lt;/span&gt; &lt;span style="color: #2b91af"&gt;&lt;span style="color: #2b91af"&gt;PrismGridViewCheckBoxColumn&lt;/span&gt;&lt;/span&gt; : &lt;span style="color: #2b91af; font-size: 9px"&gt;&lt;span style="color: #2b91af; font-size: 9px"&gt;&lt;span style="font-size: 10pt"&gt;ITemplate&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;&lt;span style="color: #2b91af; font-size: 9px"&gt;&lt;span style="color: #2b91af; font-size: 9px"&gt;&lt;span style="color: #000000; font-size: 10pt"&gt;and it implements InstantiateIn as such:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size: 10pt"&gt;&lt;span style="color: #2b91af; font-size: 9px"&gt;&lt;span style="color: #2b91af; font-size: 9px"&gt;&lt;span style="color: #000000; font-size: 13px"&gt;&lt;span style="font-size: 9pt"&gt;&lt;span style="font-size: 10pt"&gt;&lt;span style="color: #0000ff"&gt;&lt;span style="color: #0000ff"&gt;public void&lt;/span&gt;&lt;/span&gt; InstantiateIn(System.Web.UI.&lt;span style="color: #2b91af"&gt;&lt;span style="color: #2b91af"&gt;Control&lt;/span&gt;&lt;/span&gt; container)&lt;/span&gt;&lt;/span&gt; 
&lt;p&gt; &lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</description></item></channel></rss>