<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>CSS Friendly Control Adapters</title><link>http://forums.asp.net/1018.aspx</link><description>Discuss the CSS Friendly Control Adapters sample project, ask questions, post bugs, etc</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1695277.aspx</link><pubDate>Fri, 04 May 2007 15:51:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1695277</guid><dc:creator>hotfirewire</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1695277.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1695277</wfw:commentRss><description>&lt;p&gt;I've updated the code I was using.&amp;nbsp; I had to add the line (&lt;font color=#0000ff&gt;If&lt;/font&gt;&lt;font size=2&gt; row.RowIndex &amp;lt; ControlAsDetailsView.Rows.Count - 1 &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Then&lt;/font&gt;) because I was getting an error every time I did an insert.&lt;/p&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt; row.RowIndex &amp;lt; ControlAsDetailsView.Rows.Count - 1 &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Then&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt; ((&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Not&lt;/font&gt;&lt;font size=2&gt; ControlAsDetailsView.AutoGenerateRows) &lt;/font&gt;&lt;font color=#0000ff size=2&gt;AndAlso&lt;/font&gt;&lt;font size=2&gt; _
&lt;p&gt;((row.RowState &lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;And&lt;/font&gt;&lt;font size=2&gt; DataControlRowState.Insert) = DataControlRowState.Insert) &lt;/font&gt;&lt;font color=#0000ff size=2&gt;AndAlso&lt;/font&gt;&lt;font size=2&gt; _
&lt;p&gt;(&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Not&lt;/font&gt;&lt;font size=2&gt; ControlAsDetailsView.Fields.Item(row.RowIndex).InsertVisible)) &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Then&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;Continue&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;For&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1695244.aspx</link><pubDate>Fri, 04 May 2007 15:37:37 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1695244</guid><dc:creator>hotfirewire</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1695244.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1695244</wfw:commentRss><description>&lt;p&gt;To fix the visible problem I added the following code to my DetailsViewAdapter.vb&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font size=2&gt;writer.WriteLine()&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;writer.WriteBeginTag(&lt;font color=#a31515 size=2&gt;"li"&lt;/font&gt;&lt;font size=2&gt;)&lt;/font&gt;&lt;font size=2&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#008000 size=2&gt;' Added in to check for visible=false &amp;amp; insertvisable=false rows&lt;/font&gt;&lt;/p&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;' Check for a row with valid fields&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt; row.RowIndex &amp;lt; ControlAsDetailsView.Rows.Count - 1 &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Then&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;' If visible is false set style to display:none&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt; ControlAsDetailsView.Fields.Item(row.RowIndex).Visible = &lt;/font&gt;&lt;font color=#0000ff size=2&gt;False&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Then&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;writer.WriteAttribute(&lt;/p&gt;&lt;/font&gt;&lt;font color=#a31515 size=2&gt;"style"&lt;/font&gt;&lt;font size=2&gt;, &lt;/font&gt;&lt;font color=#a31515 size=2&gt;"display:none;"&lt;/font&gt;&lt;font size=2&gt;)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#008000 size=2&gt;' If InsertVisible is false set style to display:none only on insert&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt; (ControlAsDetailsView.Fields.Item(row.RowIndex).InsertVisible = &lt;/font&gt;&lt;font color=#0000ff size=2&gt;False&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;AndAlso&lt;/font&gt;&lt;font size=2&gt; _
&lt;p&gt;(row.RowState &lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;And&lt;/font&gt;&lt;font size=2&gt; DataControlRowState.Insert) = DataControlRowState.Insert) &lt;/font&gt;&lt;font color=#0000ff size=2&gt;Then&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;writer.WriteAttribute(&lt;/p&gt;&lt;/font&gt;&lt;font color=#a31515 size=2&gt;"style"&lt;/font&gt;&lt;font size=2&gt;, &lt;/font&gt;&lt;font color=#a31515 size=2&gt;"display:none;"&lt;/font&gt;&lt;font size=2&gt;)&lt;/font&gt;
&lt;p&gt;&lt;font color=#008000 size=2&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size=2&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;&lt;font size=2&gt; 
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;End&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;If&lt;/font&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1689703.aspx</link><pubDate>Tue, 01 May 2007 13:43:01 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1689703</guid><dc:creator>bdemarzo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1689703.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1689703</wfw:commentRss><description>Feel free to document your proposed changes and &lt;a href="http://www.codeplex.com/cssfriendly/WorkItem/AdvancedList.aspx"&gt;post them on the CodePlex site&lt;/a&gt; so we can review and incorporate them.&lt;br /&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1689450.aspx</link><pubDate>Tue, 01 May 2007 09:32:50 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1689450</guid><dc:creator>cavyn</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1689450.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1689450</wfw:commentRss><description>&lt;p&gt;I've just got the control adapters and have noticed this code seems to have been added to the latest vers to handle rendering fields not set to visible. This is fine when using Fields ie &lt;/p&gt;&lt;p&gt;ControlAsDetailsView.Fields[row.RowIndex].Visible but if the rows are set to Visible = false then there also needs to be a check for ControlAsDetailsView.Rows[row.RowIndex].Visible&lt;/p&gt;&lt;p&gt;I like the adapter framework and hopefully the next iteration of asp.net controls will render nicer markup like this natively. &amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1341063.aspx</link><pubDate>Fri, 14 Jul 2006 02:40:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1341063</guid><dc:creator>TPS</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1341063.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1341063</wfw:commentRss><description>&lt;p&gt;Hey Russ, I will post this in some other forums, but could you just check it out yourself.&amp;nbsp; Dealing with the DetailsView control adapter, you could just remove a field and then update a record.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Lete me know if you wipe out data as well if you would.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1341018.aspx</link><pubDate>Fri, 14 Jul 2006 00:31:35 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1341018</guid><dc:creator>Russ Helfand</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1341018.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1341018</wfw:commentRss><description>Interesting.&amp;nbsp; Have you looked around on the web for more info on this problem?&amp;nbsp; You might want to post this on another forum to see what folks say.&amp;nbsp; Offhand I've not run into this myself so I'm not sure what to tell you right now.</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1340900.aspx</link><pubDate>Thu, 13 Jul 2006 21:43:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1340900</guid><dc:creator>TPS</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1340900.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1340900</wfw:commentRss><description>&lt;p&gt;Sorry Russ, I didn't mean to imply that if we used your new if statement that empty &amp;lt;li&amp;gt; were showing up.&lt;/p&gt;
&lt;p&gt;Just scratch what I said in my last post.&lt;/p&gt;
&lt;p&gt;By the way, I know this has nothing to do with your great control adapter, but could you tell me if I am loosing my mind on this DetailsView issue.&lt;/p&gt;
&lt;p&gt;If you don't include a field from the datasource in the DetailsView, the existing data in that field will be wiped out after you edit that row in the DetailsView when it is bound to an ObjectDataSource.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;Table fields: First, Last, Address, Payrate&lt;/p&gt;
&lt;p&gt;Table row values: Bob, Schmo, 123 Main, 125&lt;/p&gt;
&lt;p&gt;Edit row in DetailsView&lt;/p&gt;
&lt;p&gt;First: Bob changes to Robert&lt;/p&gt;
&lt;p&gt;Last: Schmo&lt;/p&gt;
&lt;p&gt;Address: 123 Main&lt;/p&gt;
&lt;p&gt;Click Update &lt;/p&gt;
&lt;p&gt;Table Row values: Robert, Schmo, 123 Main, 0&lt;/p&gt;
&lt;p&gt;----------------------------------------&lt;/p&gt;
&lt;p&gt;It seems the DetailsView ObjectDataSource is generating a new object, populating the object and sending it back with the MyBizObj.Update.&amp;nbsp; Which would send the PayRate field back as 0.&lt;/p&gt;
&lt;p&gt;Instead it should Get the object from the DB, populate it with the DetailsView fields and send it back to the DB.&lt;/p&gt;
&lt;p&gt;This is very easy to Reproduce.&lt;/p&gt;
&lt;p&gt;We ended up wiping out lots of data because a form we were giving to a user didn't include 4 or 5 fields of sensitive data.&amp;nbsp; All of the sensitive data is now gone for the rows that she edited.&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1340737.aspx</link><pubDate>Thu, 13 Jul 2006 19:08:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1340737</guid><dc:creator>Russ Helfand</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1340737.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1340737</wfw:commentRss><description>&lt;p&gt;Hi Terrence,&lt;/p&gt;
&lt;p&gt;Hmmmm.&amp;nbsp; I don't know why you are seeing empty &amp;lt;li&amp;gt; elements in your markup.&amp;nbsp; The code shown above shouldn't result in that:&lt;/p&gt;
&lt;p&gt;if ((!ControlAsDetailsView.AutoGenerateRows) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((row.RowState &amp;amp; DataControlRowState.Insert) == DataControlRowState.Insert) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (!ControlAsDetailsView.Fields[row.RowIndex].InsertVisible))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; continue;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;This should cause the entire &amp;lt;li&amp;gt;'s generation to be aborted if you are in insert mode but the field is marked as InsertVisible==false.&lt;/p&gt;
&lt;p&gt;Did you put this immediately inside the foreach, before the &amp;lt;li&amp;gt; is spit out into the writer?&lt;/p&gt;
&lt;p&gt;There is a small problem insofar as the calculation of odd/even rows as a result of potentially skipping some rows because of this new heuristic.&amp;nbsp; I'll clean that up for the next rev.&lt;/p&gt;
&lt;p&gt;And speaking of the next rev, all I can say is that it is definitely happening and won't be too long: a matter of a few weeks or a couple months, at most.&amp;nbsp; Hang tight.&amp;nbsp; It's like remodeling a house: you have to rip stuff up a bit before you put it back together into an improved state.&amp;nbsp; We're not done cleaning up from some of the refactoring, etc.&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1339876.aspx</link><pubDate>Thu, 13 Jul 2006 03:43:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1339876</guid><dc:creator>TPS</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1339876.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1339876</wfw:commentRss><description>&lt;p&gt;Russ, I see what you mean about the InsertVisible.&lt;/p&gt;
&lt;p&gt;I now see that the fields are not getting rendered if InsertVisible is false, but the &amp;lt;li&amp;gt; row is getting generated, so if I have 3 hidden fields I get 3 blank rows.&lt;/p&gt;
&lt;p&gt;I know you are a busy man, but any idea when the next rev will be coming out?&amp;nbsp; I love the controls.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Terrence&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1337142.aspx</link><pubDate>Mon, 10 Jul 2006 18:33:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1337142</guid><dc:creator>Russ Helfand</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1337142.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1337142</wfw:commentRss><description>&lt;p&gt;Hi Terrence, you asked in an earlier post (in this thread) if we ought to further modify the "if" expression to specifically cover the "view" and "edit" cases, beside the "insert" case.&amp;nbsp; I think the answer is that we don't really need to.&amp;nbsp; The property InsertVisible is rather unique.&amp;nbsp; There is no counterpart to it.&amp;nbsp; There is no EditVisible or ViewVisible property.&amp;nbsp; So it seems like we really only need to handle InsertVisible when we are in insert mode.&amp;nbsp; Otherwise, we can ignore it and don't have any other comparable attributes to worry about.&amp;nbsp; I think the framework (deeper down) handles the case where Visible=false by not trying to do the render at all.&amp;nbsp; Let me know if you seem to see evidence that that isn't so.&lt;/p&gt;
&lt;p&gt;Now, regarding your other ideas:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Creating some additional themes is an interesting idea.&amp;nbsp; Frankly, it would be a great way for some enterprising developer/designer to make some good money.&amp;nbsp; Someone could start building themes that specifically work with the kit's adapters (together with skins that work when the adapters aren't being used... for old browsers, etc.).&amp;nbsp; Maybe there is a market for such themes. Meanwhile, I'll keep your suggestion (free additional themes for the kit) in mind but I must admit that there's plenty of work "on the plate" having to do with extending the kit to cover more controls and more control properties (attributes). Ahhhhh, I had making choices like this!&lt;/li&gt;
&lt;li&gt;Building a GridViewAdapter is already on my radar.&amp;nbsp; In fact, I've already started the work. I intend to include it in the next rev of the kit.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Please keep providing feedback.&amp;nbsp; It's very helpful.&amp;nbsp; Best regards,&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1336048.aspx</link><pubDate>Sun, 09 Jul 2006 03:19:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1336048</guid><dc:creator>TPS</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1336048.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1336048</wfw:commentRss><description>&lt;p&gt;Hey Russ, on another note, have you guys:&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp; Come up with anymore themes?&amp;nbsp; I know we can come up with them, but I'm a data man and making sights look good is not my strong point.&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp; Come up with a Control Adapter for the GridView?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks again for the great tools you guys are coming up with.&lt;/p&gt;
&lt;p&gt;Terrence&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1336044.aspx</link><pubDate>Sun, 09 Jul 2006 03:06:50 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1336044</guid><dc:creator>TPS</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1336044.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1336044</wfw:commentRss><description>&lt;p&gt;Hey Russ, that looks like it will work for Insert mode.&amp;nbsp; But what about just plain old view mode when you are looking at a DetailsView.&amp;nbsp; It seems that you are only accounting for Insert Mode.&lt;/p&gt;
&lt;p&gt;I know my solution is short sighted because I don't have enough knowledge to think about rowstate and whether we are in insert mode or not, but now you have me thinking.&lt;/p&gt;
&lt;p&gt;My solution does not account for the developer who purposely decides not to have a row HeaderText set.&lt;/p&gt;
&lt;p&gt;But your "ControlAsDetailsView.Fields[row.RowIndex].InsertVisible" is what I was really looking for, so how about...&lt;/p&gt;
&lt;p&gt;(psuedo code)&lt;/p&gt;
&lt;p&gt;if&amp;nbsp; ( (InsertMode &amp;amp; InsertVisible) || (EditMode &amp;amp; Visible) || (ViewMode &amp;amp; Visible) )&lt;/p&gt;
&lt;p&gt;Doesn't that cover all the situations?&lt;/p&gt;
&lt;p&gt;I guess you have the following statement include for performance because you would not be making this check if you were auto gening the rows.&lt;/p&gt;
&lt;p&gt;((!ControlAsDetailsView.AutoGenerateRows&lt;/p&gt;
&lt;p&gt;Thanks for you fast response Russ, I look forward to your response so I can put this bit of the site configuration to bed.&lt;/p&gt;
&lt;p&gt;Terrence&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1336019.aspx</link><pubDate>Sun, 09 Jul 2006 00:24:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1336019</guid><dc:creator>Russ Helfand</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1336019.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1336019</wfw:commentRss><description>&lt;p&gt;Cool, TPS.&amp;nbsp; Thanks for contributing that.&lt;/p&gt;
&lt;p&gt;I ended up with a slightly different "if" expression:&lt;/p&gt;
&lt;p&gt;if ((!ControlAsDetailsView.AutoGenerateRows) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((row.RowState &amp;amp; DataControlRowState.Insert) == DataControlRowState.Insert) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (!ControlAsDetailsView.Fields[row.RowIndex].InsertVisible))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; continue;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;I put this just inside the "foreach" statement you referred to (above).&amp;nbsp; What do you think of this alternative?&lt;/p&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1336007.aspx</link><pubDate>Sat, 08 Jul 2006 23:28:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1336007</guid><dc:creator>TPS</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1336007.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1336007</wfw:commentRss><description>&lt;p&gt;Brian, here is a quick fix for the rows showing up that have been marked as visible.&lt;/p&gt;
&lt;p&gt;Open up the DetailsViewAdapter.cs file and add this if statement after the foreach statement.&lt;/p&gt;
&lt;p&gt;Rows that are marked as visible=false, the HeaderText value is "&amp;amp;nbsp;"&amp;nbsp; So if it is not "&amp;amp;nbsp;"&amp;nbsp;&amp;nbsp; then it must be marked as visible.&lt;/p&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;foreach&lt;/font&gt;&lt;font size=2&gt; (&lt;/font&gt;&lt;font color=#008080 size=2&gt;DetailsViewRow&lt;/font&gt;&lt;font size=2&gt; row &lt;/font&gt;&lt;font color=#0000ff size=2&gt;in&lt;/font&gt;&lt;font size=2&gt; ControlAsDetailsView.Rows)
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;if&lt;/font&gt;&lt;font size=2&gt; (row.Cells[0].Text != &lt;/font&gt;&lt;font color=#800000 size=2&gt;"&amp;amp;nbsp;"&lt;/font&gt;&lt;font size=2&gt;)
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: asp:DetailsView renders incorrectly with CSS friendly control adapter</title><link>http://forums.asp.net/thread/1286103.aspx</link><pubDate>Mon, 15 May 2006 15:55:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1286103</guid><dc:creator>Russ Helfand</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1286103.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1286103</wfw:commentRss><description>&lt;p&gt;For those interested in simulating the original problem having to do with InsertVisible... go to DetailsViewExample.aspx and alter the DetailsView so it looks like this:&lt;/p&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;DetailsView&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;ID&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="DetailsView1"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;Runat&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="server"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font&gt;&lt;font color=#ff0000 size=2&gt;DefaultMode&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Insert"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;SkinID&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="SampleDetailsView"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataSourceID&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="AuthorsDS"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;AutoGenerateRows&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="False"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Author Details"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;AllowPaging&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="True"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;CssSelectorClass&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="PrettyDetailsView"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;OnItemUpdated&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="FakeItemUpdate"&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;Fields&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;BoundField&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font&gt;&lt;font color=#ff0000 size=2&gt;InsertVisible&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="False"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="ID"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataField&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="au_id"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;BoundField&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font&gt;&lt;font color=#ff0000 size=2&gt;InsertVisible&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="False"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Last name"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataField&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="au_lname"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;BoundField&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font&gt;&lt;font color=#ff0000 size=2&gt;InsertVisible&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="False"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="First name"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataField&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="au_fname"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;BoundField&lt;/font&gt;&lt;font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;InsertVisible&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="False"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Phone"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataField&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="phone"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;BoundField&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font&gt;&lt;font color=#ff0000 size=2&gt;InsertVisible&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="False"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Street"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataField&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="address"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;BoundField&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font&gt;&lt;font color=#ff0000 size=2&gt;InsertVisible&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="False"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="City"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataField&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="city"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;BoundField&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font&gt;&lt;font color=#ff0000 size=2&gt;InsertVisible&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="False"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="State"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataField&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="state"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;BoundField&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="ZIP code"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataField&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="zip"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;BoundField&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font&gt;&lt;font color=#ff0000 size=2&gt;InsertVisible&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="False"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;HeaderText&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Contract"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;DataField&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="contract"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;CommandField&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;ShowInsertButton&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="True"&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;/&lt;/font&gt;&lt;font color=#800000 size=2&gt;Fields&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;/&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;DetailsView&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;/font&gt;
&lt;p&gt;Run the page.&amp;nbsp; Only the ZIP code line should show up because the other bound fields are explicitly marked with InsertVisible="False". That's the problem with the current implementation of the DetailsViewAdapter.&amp;nbsp; I'm working on a fix...&lt;/p&gt;</description></item></channel></rss>