﻿<?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 - Refresh Grid with new data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Grid-with-new-data/</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>Refresh Grid with new data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Grid-with-new-data/</link><pubDate>Wed, 24 Feb 2010 06:02:55 GMT</pubDate><dc:creator>julia</dc:creator><description>&lt;p&gt;Hi Tenika,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If you want to bind the data, you need to put the code inside InitializeDataSource event. As well for modified outside of the grid, you could use this code to refresh the data :&lt;/p&gt;&lt;pre&gt;protected void btnSave_Click(object sender, EventArgs e)
    {
        DataSet ds = SaveDataReturnsNewDataSet(DropDownList1.SelectedValue, TextBox1.Text);
        if (ds != null)
        {
            WebGrid1.ClientAction.Refresh();
        }

    }
&lt;/pre&gt;
&lt;p&gt;The code will InitializeDataSource and get the latest data.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Julia&lt;/p&gt;</description></item><item><title>Refresh Grid with new data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Grid-with-new-data/</link><pubDate>Tue, 23 Feb 2010 09:36:27 GMT</pubDate><dc:creator>tlusby</dc:creator><description>&lt;p&gt;Julia,&lt;/p&gt;
&lt;p&gt;I know how to bind to the WebGrid when I'm modifying the grid but like I mentioned above this is modifying the data &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;OUTSIDE&lt;/span&gt; &lt;/strong&gt;of the gird.&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:dropdownlist id="ddlList" runat="server"&amp;gt;&amp;lt;/asp:dropdownlist&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:textbox id="txtValue" runat="Server"&amp;gt;&amp;lt;/asp:textbox&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:button id="btnSave" runat="Server"  onclick="btnSave_Click"&amp;gt;&amp;lt;/asp:button&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="600px" UseDefaultStyle="false" Width="100%" OnInitializeDataSource="WebGrid1_InitializeDataSource"&lt;br /&gt;OnPrepareDataBinding="WebGrid1_PrepareDataBinding" oninitializelayout="WebGrid1_InitializeLayout"&lt;br /&gt;oninitializerow="WebGrid1_InitializeRow" onbatchupdate="WebGrid1_BatchUpdate"&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/ISWebGrid:WebGrid&amp;gt;&lt;/p&gt;
&lt;p&gt;..&lt;/p&gt;
&lt;p&gt;protected void btnSave_Click(object sender, Event Args e)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;    DatSet ds = SaveDataReturnsNewDataSet(ddlList.SelectedValue, txtValue.Text);&lt;/p&gt;
&lt;p&gt;    if (ds != null) {&lt;/p&gt;
&lt;p&gt;         WebGrid1.DataSource = ds;&lt;/p&gt;
&lt;p&gt;         WebGrid1.DataBind();&lt;/p&gt;
&lt;p&gt;    }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This is what I'm looking for...&lt;/p&gt;</description></item><item><title>Refresh Grid with new data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Grid-with-new-data/</link><pubDate>Tue, 23 Feb 2010 06:41:17 GMT</pubDate><dc:creator>julia</dc:creator><description>&lt;p&gt;Hi Tenika,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;We recommended you to use e.DataSource = dt; instead of WebGrid1.DataSource = dt; and then placed it in WebGrid1_InitializeDataSource event. Also, you don't need to add code WebGrid1.ClearCachedDataSource(); and WebGrid1.Databind();&lt;/p&gt;
&lt;p&gt;Below is an attachment of my simple sample on how to bind from server side that we recommended. Please find a file name BindServerSide.rar. You could use this method when you want to create server side binding.&lt;/p&gt;
&lt;p&gt;I hope this can help.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Julia&lt;/p&gt;</description></item><item><title>Refresh Grid with new data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Refresh-Grid-with-new-data/</link><pubDate>Mon, 22 Feb 2010 18:09:58 GMT</pubDate><dc:creator>tlusby</dc:creator><description>&lt;p&gt;I have a grid that is using CachedDataSource().  Above the grid the user can enter information and save to the database.  The save method returns the saved data that I want to display in the grid.  &lt;/p&gt;
&lt;p&gt;I tried &lt;/p&gt;&lt;span style="font-size: 13px"&gt;&lt;p&gt;WebGrid1.ClearCachedDataSource();&lt;/p&gt;&lt;/span&gt;
&lt;p&gt;WebGrid1.Datasource = ds;&lt;/p&gt;
&lt;p&gt;WebGrid1.Databind();&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;However the grid didn't not refresh.  Again this update is being done outside of the webgrid, so there is no AcceptAllChanges.  So above the grid is a dropdown(column) and textbox (value) and button that will save this save to the database.  The database will return a new dataset with the updated data.  I want to bind that new data to existing grid.&lt;/p&gt;</description></item></channel></rss>