﻿<?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 - Update webgrid data from outside the webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Update-webgrid-data-from-outside-the-webgrid/</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>Update webgrid data from outside the webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Update-webgrid-data-from-outside-the-webgrid/</link><pubDate>Thu, 12 Jul 2012 21:50:20 GMT</pubDate><dc:creator>Hans</dc:creator><description>Hi,&lt;br /&gt;&lt;br /&gt;I’m glad to hear that you’ve found a workaround for this issue.&lt;br /&gt;&lt;br /&gt;Yes, there is a way to change the Batch Update through client side event (javascript).&lt;br /&gt;For example, perhaps you could use OnUndoallChanges() or OnAcceptAllChanges().&lt;br /&gt;You could see more information about our WebGrid’s client side event in our documentation.&lt;br /&gt;&lt;br /&gt;Should you have further question, please do not hesitate to contact us.&lt;br /&gt;I would be happy to help you again.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.</description></item><item><title>Update webgrid data from outside the webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Update-webgrid-data-from-outside-the-webgrid/</link><pubDate>Thu, 12 Jul 2012 02:23:00 GMT</pubDate><dc:creator>UPratap@dow.com</dc:creator><description>&lt;p&gt;Thanks Hans! I was able to solve the issue. I have used your code and made PromptUnsavedChanges="false" to make it work. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Is there a way to change the Batch Update settings property at run time in javascript? Please let me know.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;btw, I am marking your solution as the correct approach. It works absolutely grt! :) Thanks for the solution.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;-Udayan&lt;/p&gt;</description></item><item><title>Update webgrid data from outside the webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Update-webgrid-data-from-outside-the-webgrid/</link><pubDate>Wed, 11 Jul 2012 22:26:20 GMT</pubDate><dc:creator>Hans</dc:creator><description>Hi,&lt;br /&gt;&lt;br /&gt;Thank you for your reply and I’m sorry for the late response.&lt;br /&gt;&lt;br /&gt;The setInterval() method calls a function or evaluates an expression at specified intervals (in milliseconds).&lt;br /&gt;The setInterval() method will continue calling the function until clearInterval() is called, or the window is closed.&lt;br /&gt;Or you could find more information about this method from another website.&lt;br /&gt;&lt;br /&gt;If I remove the setInterval() method (from my sample), it can only apply changes in one row.&lt;br /&gt;You could try to remove the setInterval() method (from my sample) and see the effect.&lt;br /&gt;&lt;br /&gt;I apologize for the inconvenience.&lt;br /&gt;I try to remove the setInterval() method. But unfortunately, I can’t replicate your issue on my end.&lt;br /&gt;&lt;br /&gt;Could you tell me the step by step how to reproduce this issue?&lt;br /&gt;Or if you don’t mind, could you provide me simple sample that replicate this issue?&lt;br /&gt;&lt;br /&gt;Thank you.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Update webgrid data from outside the webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Update-webgrid-data-from-outside-the-webgrid/</link><pubDate>Tue, 10 Jul 2012 04:44:03 GMT</pubDate><dc:creator>UPratap@dow.com</dc:creator><description>&lt;p&gt;Hans,&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;Thanks for the code. I have made some changes to the code and it works fine (except for one small issue that I am facing).&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;function saveDecision() {
        var grid = ISGetObject("WebGrid1");
        var ddl = document.getElementById("&amp;lt;%= ddlDecision.ClientID %&amp;gt;");
        var checkedRows = grid.RootTable.GetCheckedRows();
        var ddlValue = ddl.options[ddl.selectedIndex].value;
        if (checkedRows.length &amp;gt; 0) {
            if (!grid.IsInProgress) {
                for (i = 0; i &amp;lt; checkedRows.length; i&amp;#43;&amp;#43;) {
                    var checkedRow = grid.RootTable.GetCheckedRows()[i];
                    var selectedRow = grid.RootTable.ToRowObject(checkedRow);
                    var cells = selectedRow.GetCells();
                    if (selectedRow.KeyValue != '') {
                        // update the selected row's cells value
                        cells.GetNamedItem("Decision").SetText(ddlValue, true);
                        // update the selected row object
                        selectedRow.Update();
                    }
                }
                if (i &amp;gt;= checkedRows.length) {
                    i = 0;
                }
            }
        }
        return true;
    }&lt;/pre&gt;
&lt;p&gt; I have removed the setInterval function from the code. I am not sure why do we need it. Please let me know what is the purpose of this function.&lt;/p&gt;
&lt;p&gt;Also, though it is working fine, I am finding that a pop-up window opens in the grid that states "Are you sure you want to navigate away from the page?....." &amp;lt;attachment - error.jpg&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Please let me know how to take this out?&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Update webgrid data from outside the webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Update-webgrid-data-from-outside-the-webgrid/</link><pubDate>Mon, 09 Jul 2012 03:17:18 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for the question and I apologize for the inconvenience.&lt;br /&gt;&lt;br /&gt;I’ve made a simple sample that maybe similar with your current scenario. I bind the WebGrid to Northwind.mdb database and Shippers table.&lt;br /&gt;In my sample, you could update CompanyName column’s value, based on WebCombo’s value.&lt;br /&gt;&lt;br /&gt;I use SetText() method to update the selected row's cells (CompanyName) value.&lt;br /&gt;And I use Update() method to update the selected row object.&lt;br /&gt;I also set PersistRowChecker property of WebGrid to “True”. This makes the row checker is not being cleared during postback.&lt;br /&gt;&lt;br /&gt;Here’s the example java script code how to update selected row in WebGrid:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;var i = 0;var intervalObj;
function WebButton1_OnClientClick(controlId, parameter) {
    var WebButton1 = ISGetObject(controlId);
    var WebCombo1 = ISGetObject("WebCombo1");
    var WebGrid1 = ISGetObject("WebGrid1");
    var comboValue = WebCombo1.Value; // Get WebCombo Value
    var checkedRows = WebGrid1.RootTable.GetCheckedRows();
    if (checkedRows.length &amp;gt; 0) {
        intervalObj = setInterval(function () {
            if (!WebGrid1.IsInProgress) {
                if (i &amp;lt; checkedRows.length) {
                    var checkedRow = WebGrid1.RootTable.GetCheckedRows()[i];
                    var selectedRow = WebGrid1.RootTable.ToRowObject(checkedRow);
                    var cells = selectedRow.GetCells();
                    if (selectedRow.KeyValue != '') {
                        // update the selected row's cells value
                        cells.GetNamedItem("CompanyName").SetText(comboValue, true);
                        // update the selected row object
                        selectedRow.Update();
                    }
                    i&amp;#43;&amp;#43;;
                }
                if (i &amp;gt;= checkedRows.length) {
                    clearInterval(intervalObj);
                    intervalObj = null;
                    i = 0;
                }
            }
        }, 5);
    }
    return true;
}&lt;/pre&gt;
&lt;p&gt;Please have a review on my sample as well and let me hear your response.&lt;br /&gt;&lt;br /&gt;Thank you.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Update webgrid data from outside the webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Update-webgrid-data-from-outside-the-webgrid/</link><pubDate>Fri, 06 Jul 2012 15:51:33 GMT</pubDate><dc:creator>UPratap@dow.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have a drop-down list outside the webgrid. The webgrid has two columns -&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;a) Decision (edittype = dropdownlist)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;b) Checkbox Column&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Scenario: The users want to check multiple check boxes in the grid, then use the drop-down list (which is outside the webgrid) to make a selection, click on a button next to the drop-down.&lt;/p&gt;
&lt;p&gt;Expectation : The Decision column will show the value selected from the dropdown. And refreshes the data in the webgrid.&lt;/p&gt;
&lt;p&gt;What is happening : The data is updated at the back-end in the database, but the grid is not showing the refreshed data. On rt clicking &amp;#43; Refresh, the new data is shown.&lt;/p&gt;
&lt;p&gt;What I want - Is there a way to refresh the webgrid on the button click event once the data is written back to the database? I tried WebGrid1.ClientAction.Refresh in btn_Click event but its not refreshing the grid. i also tried WebGrid1.ClientAction.InvokeScript("ISGetObject('" &amp;#43; WebGrid1.ClientID &amp;#43; "').Refresh();") but it doesnt work.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>