﻿<?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 - Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</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>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Thu, 09 Dec 2010 21:24:20 GMT</pubDate><dc:creator>niven</dc:creator><description>&lt;p&gt;Hi Shawn,&lt;/p&gt;
&lt;p&gt;Thank you for the re-explanation.&lt;/p&gt;
&lt;p&gt;Please try my attached sample, hope this can fulfill your wanted scenario.&lt;/p&gt;
&lt;p&gt;If not, please advise me with your scenario, then I will try to deliver as you wanted.&lt;/p&gt;
&lt;p&gt;I'm using the Northwind Database. You can find it on Intersoft's folder.&lt;/p&gt;
&lt;p&gt;I apologize but we do not support a client side event that occurs when the user clicks the default "Add New Row".&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Thank you and have a nice weekend.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Thu, 09 Dec 2010 11:06:05 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Hi Shawn,&lt;/p&gt;&lt;p&gt;I apologize for the misunderstanding. I think I am getting lost and want to clear the questions first.&lt;/p&gt;&lt;p&gt;So you want to access the new row but you dont want your users to add something within the new row field? If you want this scenario, I can suggest you to handle this scenario on OnRowSelect client-side event and set the validation if the ColumnType is new row then set to no edit type.&lt;/p&gt;&lt;p&gt;And If below is not the scenario you wanted, have you tried my previous snippet code that hide the new row? Even it is hidden, you can still&amp;nbsp;adding a new row. Only the style was hidden you still can access it.&lt;/p&gt;&lt;p&gt;Thank you and have a nice day.&lt;/p&gt;&lt;p&gt;Once again, I apologize for my misunderstanding.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I'll try to explain.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Is there a client-side event that occurs when the user clicks on the default "Add New Row" row that is displayed when the WebGrid is enabled to allow new rows? I need to perform some logic such as defaulting and loading controls on a new row.  I didn't find any event so I am using a button and its OnClick event. &lt;br /&gt;&lt;br /&gt;So, I need a way to completely hide that "Add New Row' row which is done using the server-side code that I provided above. However, the user is still able to click into that row by clicking on that * character as I showed you.  I need to prevent that.&lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Thu, 09 Dec 2010 03:11:22 GMT</pubDate><dc:creator>niven</dc:creator><description>&lt;p&gt;Hi Shawn,&lt;/p&gt;
&lt;p&gt;I apologize for the misunderstanding. I think I am getting lost and want to clear the questions first.&lt;/p&gt;
&lt;p&gt;So you want to access the new row but you dont want your users to add something within the new row field? If you want this scenario, I can suggest you to handle this scenario on OnRowSelect client-side event and set the validation if the ColumnType is new row then set to no edit type.&lt;/p&gt;
&lt;p&gt;And If below is not the scenario you wanted, have you tried my previous snippet code that hide the new row? Even it is hidden, you can still adding a new row. Only the style was hidden you still can access it.&lt;/p&gt;
&lt;p&gt;Thank you and have a nice day.&lt;/p&gt;
&lt;p&gt;Once again, I apologize for my misunderstanding.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Wed, 08 Dec 2010 10:02:12 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Hi Shawn,&lt;/p&gt;&lt;p&gt;The 'this.Column.ColumnType' is null or not an object because the it cant find the NewRow.&lt;/p&gt;&lt;p&gt;What if I suggest you using the one at our WebGrid's sample, Client_ProgrammaticEdit?&lt;/p&gt;&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;p&gt;Thank you.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;That is not the desired approach of my company.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Is there a way to catch an event when the user clicks the default "Add New Row" area that is reserved for the WebGrid's New Row? This would fix my problem as I would not have to rely on providing a mechanism (button and WebGrid's Context Menu function) to display a new row and default data. If not, I need a way to prevent the user from clicking the default "Add New Row" area &lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Wed, 08 Dec 2010 03:26:40 GMT</pubDate><dc:creator>niven</dc:creator><description>&lt;p&gt;Hi Shawn,&lt;/p&gt;
&lt;p&gt;The 'this.Column.ColumnType' is null or not an object because the it cant find the NewRow.&lt;/p&gt;
&lt;p&gt;What if I suggest you using the one at our WebGrid's sample, Client_ProgrammaticEdit?&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Fri, 03 Dec 2010 11:03:57 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;p&gt;I wasn't clear with my request.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I am currently using a button to trigger a new row. This is necessary because I need to perform some logic to default data, enable/disable fields, etc. and I could not find a way to do that when the user clicks the default "New Row".  I hoped by hiding this row that I could only provide 1 way for the user to create a row: the button. My implementation removes the row so they cannot click but it comes back as I have shown you.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;However, I am now getting an error because the button uses the "NewRow" object to create a new row;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;'this.Column.ColumnType' is null or not an object&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Thu, 02 Dec 2010 23:11:27 GMT</pubDate><dc:creator>niven</dc:creator><description>&lt;p&gt;Hi Shawn,&lt;/p&gt;&lt;p&gt;No, this is not the same as the server code that you currently using. On your code, you only hide the style of the new row. But my code access the object of the new row and set it to hidden. This is why when you click on the row's initial state, it still can access the new row because you only hide the new row. not the row's initial state style. FYI, we do not support the row's initial state yet.&lt;/p&gt;
&lt;p&gt;Regarding, the grid.Refresh(); will refresh only the WebGrid or else you will see a gap down the webgrid. However, this refresh method has no relationship with postback.&lt;/p&gt;
&lt;p&gt;Hope this can clear your question.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Wed, 01 Dec 2010 09:48:00 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;blockquote&gt;&lt;p style="font-size: 10pt; font-family: 'lucida sans unicode'"&gt;Hi Shawn,&lt;/p&gt;&lt;p style="font-size: 10pt; font-family: 'lucida sans unicode'"&gt;I believe you can't achieve that on server side.&lt;/p&gt;&lt;p style="font-size: 10pt; font-family: 'lucida sans unicode'"&gt;After I investigate further, why the row's initial column be able to be invoked because the code you give to me only access the new row not the row header(row's initial column). And we have not supported the row header yet.&lt;/p&gt;&lt;p style="font-size: 10pt; font-family: 'lucida sans unicode'"&gt;Please try the following solution to hide the new row on window::onload method.&lt;/p&gt;&lt;pre&gt;function window::onload(){
    var grid = ISGetObject("WebGrid1");
    grid.RootTable.GetNewRow().style.display = "none";
    grid.Refresh();
}&lt;/pre&gt;&lt;p&gt;H&lt;span style="font-size: 13px; font-family: 'lucida sans unicode'"&gt;ope this helps. Please let me if this works on your side or not.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 13px; font-family: 'lucida sans unicode'"&gt;Thank you and have a nice day.&lt;/span&gt;&lt;/p&gt;&lt;p style="font-size: 10pt; font-family: 'lucida sans unicode'"&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Isn't this JS code the same as the server code that I am currently using? Regardless, any solution where a WebGrid's Refresh method is used causing a postback cannot be used due to performance.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Wed, 01 Dec 2010 03:34:42 GMT</pubDate><dc:creator>niven</dc:creator><description>&lt;p style="font-family: 'lucida sans unicode'; font-size: 10pt; "&gt;Hi Shawn,&lt;/p&gt;&lt;p style="font-family: 'lucida sans unicode'; font-size: 10pt; "&gt;I believe you can't achieve that on server side.&lt;/p&gt;
&lt;p style="font-family: 'lucida sans unicode'; font-size: 10pt; "&gt;After I investigate further, why the row's initial column be able to be invoked because the code you give to me only access the new row not the row header(row's initial column). And we have not supported the row header yet.&lt;/p&gt;
&lt;p style="font-family: 'lucida sans unicode'; font-size: 10pt; "&gt;Please try the following solution to hide the new row on window::onload method.&lt;/p&gt;&lt;pre&gt;function window::onload(){
    var grid = ISGetObject("WebGrid1");
    grid.RootTable.GetNewRow().style.display = "none";
    grid.Refresh();
}&lt;/pre&gt;
&lt;p&gt;H&lt;span style="font-family: 'lucida sans unicode'; font-size: 13px; "&gt;ope this helps. Please let me if this works on your side or not.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'lucida sans unicode'; font-size: 13px; "&gt;Thank you and have a nice day.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-family: 'lucida sans unicode'; font-size: 10pt; "&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Tue, 30 Nov 2010 10:19:17 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Hi Shawn,&lt;/p&gt;&lt;p&gt;I cant replicate you issur on my side. If you dont mind, could you provide me a screenshot or any more details&amp;nbsp;which part of row's&amp;nbsp;initial column&amp;nbsp;did you click?&lt;/p&gt;&lt;p&gt;Thank you and have a nice day.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Niven&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;br /&gt;Here's code to hide the New Row:&lt;/p&gt;&lt;pre&gt;        /// &amp;lt;summary&amp;gt;
        /// Handles the Treaty Claim's DataGrid control's OnInitializeLayout event
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="sender"&amp;gt;Sender&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="e"&amp;gt;Event arguments&amp;lt;/param&amp;gt;
        protected void grdTreatyClaims_OnInitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)
        {
            // Initialize 
            if (e == null) { return; }

            // Hide New Row
            // NOTE: This is done to ensure user uses custom button to create new rows
            this.grdTreatyClaims.RootTable.NewRowStyle.CssClass = Common.Utility.Constants.CSS_HIDE_CONTROL;
        } 
&lt;/pre&gt;
&lt;p&gt;I have also uploaded two images which shows the NewRow is initially hidden but then editable after clicking on the * icon.&lt;/p&gt;</description></item><item><title>Toggle the display of the "Add New Row" box</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Toggle-the-display-of-the-Add-New-Row-box/</link><pubDate>Wed, 12 May 2010 17:16:46 GMT</pubDate><dc:creator>shawncraig@yahoo.com</dc:creator><description>&lt;p&gt;Does anyone know how to toggle the Add New Row box via the client side?&lt;/p&gt;
&lt;p&gt;There is a show and a hide for GroupByBox and FilterBox but what about the Add box?&lt;/p&gt;</description></item></channel></rss>