﻿<?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 - Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</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>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Fri, 08 Apr 2011 08:29:11 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Normally, ClientAction is triggered when there is a flypostback action in the control. RenderControl is one of ClientAction method. This method is used to refresh UI control state during postback action.&lt;br /&gt;However, Disabling a WebButton doesn’t require rendering at server side during FlyPostBack Request.&lt;br /&gt;That's why it returns error when we used RenderControl.&lt;br /&gt; &lt;br /&gt;You can only do this in FullPostBack or with javascript/client approach.&lt;br /&gt;&lt;br /&gt;Therefore, If you still want to disable it in server side, you need to use InvokeScript(). This method would call your javascript function.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Thu, 07 Apr 2011 10:30:26 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Based on discussion with our developer teams, it seems this one is not a bug. &lt;br /&gt;WebButton state could not be updated with that way. Also, during the FlyPostBack (refresh), it could not be done. If you want to disable the state, you can use invoke script from server side.&lt;br /&gt;&lt;br /&gt;By using invoke script, you can call your javascript function to disable the state.&amp;nbsp;&lt;br /&gt;Unfortunately, this is the only way. WebButton won't be render the html because the state is disabled due to Invoke script call.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks for your reply. Can you explain this a bit more? &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Also, the example that you provided won't work? What's the purpose of the WebGrid's ClientAction's RenderControl method?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;protected void WebGrid1_InitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e)
    {
        if (e.Action == PostBackAction.RefreshData)
        {
            WebButton1.Enabled = false;
            WebGrid1.ClientAction.RenderControl(WebButton1);
        }
    }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Wed, 06 Apr 2011 23:43:19 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Based on discussion with our developer teams, it seems this one is not a bug. &lt;br /&gt;WebButton state could not be updated with that way. Also, during the FlyPostBack (refresh), it could not be done. If you want to disable the state, you can use invoke script from server side.&lt;br /&gt;&lt;br /&gt;By using invoke script, you can call your javascript function to disable the state. &lt;br /&gt;Unfortunately, this is the only way. WebButton won't be render the html because the state is disabled due to Invoke script call.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Wed, 06 Apr 2011 15:27:58 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;There is no workaround for now. I will ask our developer teams when it would be fixed.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I provided a work-around above. However, please let me know when the underlying bug is fixed that will allow me not to use javascript to update the button's UI.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Tue, 05 Apr 2011 04:41:22 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;There is no workaround for now. I will ask our developer teams when it would be fixed.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Fri, 01 Apr 2011 09:53:04 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Ok. I have notified this request to our developer teams. I will let you know after I got a response from them.&lt;br /&gt;Actually, you don't need the combination server and client. If you used Dexter's workaround, it should work.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I need to perform this logic on the server side. My work around above works for me.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Can your report back when this issue is resolved? Thank you.&lt;/p&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Fri, 01 Apr 2011 00:00:22 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Ok. I have notified this request to our developer teams. I will let you know after I got a response from them.&lt;br /&gt;Actually, you don't need the combination server and client. If you used Dexter's workaround, it should work.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Thu, 31 Mar 2011 11:36:17 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;It seems there is an issue in our latest build. I will forward this issue to our developer teams and will let you know the update.&lt;br /&gt;&lt;br /&gt;For temporary workaround, please try to disable/enable the WebButton from clientside.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Can you please follow-up when this bug is fixed?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;To resolve, I used a combination of server-side code (for initial load) and the Grid's InvokeScript for subsequent grid refreshes. The JavaScript just calls the WebButton's Enable/Disable method. An example:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;        /// &amp;lt;summary&amp;gt;
        /// Allow the Adjustment Factor Reports to be executed
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="allowReportsExecute"&amp;gt;Flag to indicate if reports can be executed&amp;lt;/param&amp;gt;
        /// &amp;lt;remarks&amp;gt;JavaScript is also used due to Intersoft Bug where the control is not rendered during Fly Postback mode&amp;lt;/remarks&amp;gt;
        private void AllowAdjustmentFactorReportsExecute(bool allowReportsExecute)
        {
            this.lbtnCreateAdjustmentFactorReports.Enabled = allowReportsExecute;
            string jsCode = Common.Utility.CommonHelper.GetJSCode(string.Format("{0}_EnableCreateAdjustmentFactorReportControl({1});", this.ClientID, Common.Utility.CommonHelper.GetJSBoolean(this.lbtnCreateAdjustmentFactorReports.Enabled)));
            this.grdMasterShell.ClientAction.InvokeScript(jsCode);
        }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Thu, 31 Mar 2011 03:21:04 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;It seems there is an issue in our latest build. I will forward this issue to our developer teams and will let you know the update.&lt;br /&gt;&lt;br /&gt;For temporary workaround, please try to disable/enable the WebButton from clientside.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Wed, 30 Mar 2011 11:24:26 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;For UI changes can be made on the server side only if the page is on FullPostBack mode. However, refresh is a FLyPostBack action. So, for UI changes, it is better if you do it in client.&lt;br /&gt;But if you would like to do in server, try the following code.&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_InitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e)
    {
        if (e.Action == PostBackAction.RefreshData)
        {
            WebButton1.Enabled = false;
            WebGrid1.ClientAction.RenderControl(WebButton1);
        }
    }&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Do you have a simple example? I am getting a JavaScript error using that approach. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I also tried the WebButton's &lt;strong&gt;RequiresUIRefresh&lt;/strong&gt; method but it didn't work.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;ISRes.asxd - Line 11 Invalid Character&lt;/p&gt;&lt;pre&gt;IS.RenderControl("ctl00_WebPaneManagerShell_ViewContentShell_ContentPlaceHolder_ucAdjustmentFactorReports_btnCreateReport", "&amp;lt;xml id=\'ctl00_WebPaneManagerShell_ViewContentShell_ContentPlaceHolder_ucAdjustmentFactorReports_btnCreateReport_x\'&amp;gt;&amp;lt;!--[CDATA[&amp;lt;CompressedXml&amp;gt;&amp;lt;WebButton Text=\"Create Report\" Image=\"/Endurance.Re.AWB.Web/Images/16x16/wg5_newrow.gif\" DisplayMode=\"TextAndImage\" AutoPostback=\"a\" DisabledStyle=\"W112GFA\" ProgressTextStyle=\"W1DJCD0\" ServerUniqueID=\"b$c$d$e$f$g\" UseWebResourcesForScript=\"a\" UseWebResourcesForClient=\"a\" xmlInputHiddenUniqueID=\"b$c$d$e$f$g$btnCreateReport_h\" XmlCompressionEnabled=\"a\"&amp;gt;&amp;lt;ButtonStyle Normal=\"W32AJ17\" Over=\"W8J3G1\" Active=\"W32GGF8\" /&amp;gt;&amp;lt;FlyPostBackSettings /&amp;gt;&amp;lt;/WebButton&amp;gt;&amp;lt;ISXMLMapping&amp;gt;&amp;lt;NodeKey /&amp;gt;&amp;lt;NodeValue /&amp;gt;&amp;lt;AttrKey /&amp;gt;&amp;lt;AttrValue /&amp;gt;&amp;lt;ValKey&amp;gt;gebafdc&amp;lt;/ValKey&amp;gt;&amp;lt;ValValue&amp;gt;btnCreateReportContentPlaceHolderctl00TrueucAdjustmentFactorReportsViewContentShellWebPaneManagerShell&amp;lt;/ValValue&amp;gt;&amp;lt;/ISXMLMapping&amp;gt;&amp;lt;/CompressedXml&amp;gt;]]--&amp;gt;&amp;lt;/xml&amp;gt;&amp;lt;button id=\'ctl00_WebPaneManagerShell_ViewContentShell_ContentPlaceHolder_ucAdjustmentFactorReports_btnCreateReport_f\'  class=\"W32AJ17 \" style=\'height:20px;width:125px;\'title=\'Create an adjustment factor report\' &amp;gt;&amp;lt;div&amp;gt;&amp;lt;img align=absmiddle src=\'/Endurance.Re.AWB.Web/Images/16x16/wg5_newrow.gif\' hspace=2 /&amp;gt;&amp;nbsp;Create Report&amp;lt;/div&amp;gt;&amp;lt;/button&amp;gt;&amp;lt;input type=\'hidden\' id=\'ctl00_WebPaneManagerShell_ViewContentShell_ContentPlaceHolder_ucAdjustmentFactorReports_btnCreateReport\' name=\'ctl00$WebPaneManagerShell$ViewContentShell$ContentPlaceHolder$ucAdjustmentFactorReports$btnCreateReport\"ctl00$WebPaneManagerShell$ViewContentShell$ContentPlaceHolder$ucAdjustmentFactorReports$btnCreateReport$btnCreateReport_h\" type=\"hidden\" id=\"ctl00_WebPaneManagerShell_ViewContentShell_ContentPlaceHolder_ucAdjustmentFactorReports_btnCreateReport_btnCreateReport_h\" /&amp;gt;");InitWebButton(\'ctl00_WebPaneManagerShell_ViewContentShell_ContentPlaceHolder_ucAdjustmentFactorReports_btnCreateReport\');&lt;/pre&gt;&lt;pre&gt;    /// &amp;lt;summary&amp;gt;
        /// Handles the Reports WebGrid control's OnInitializePostBack 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 grdReports_OnInitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e)
        {
            switch (e.Action)
            {
                case ISNet.WebUI.WebGrid.PostBackAction.RefreshAll:
                case ISNet.WebUI.WebGrid.PostBackAction.RefreshData:					  this.btnCreateReport.Enabled = true;
                    this.grdReports.ClientAction.RenderControl(this.btnCreateReport);
                    Common.Utility.IntersoftHelper.WebGrid.RestoreWebGridScrollPosition(this.grdReports);
                    break;
            }
        }&lt;/pre&gt;</description></item><item><title>Enable/Disable button after client-side grid refresh</title><link>http://www.intersoftsolutions.com/Community/WebGrid/EnableDisable-button-after-client-side-grid-refresh/</link><pubDate>Tue, 29 Mar 2011 10:23:14 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;p&gt;I have a webgrid that performs a client-side refresh based on a timer. After the postback occurs, the grid is updated as expected after the page life cycle. I also have a need to update other UI elements such as a WebButton but ONLY the grid's data/UI is updated.  Typically, I would wrap the button in an UpdatePanel so that AJAX would update the UI.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;How do I accomplish this using the WebButton/WebGrid scenario I described? &lt;/p&gt;</description></item></channel></rss>