﻿<?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 - BatchUpdate issue</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BatchUpdate-issue/</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>BatchUpdate issue</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BatchUpdate-issue/</link><pubDate>Mon, 20 Sep 2010 03:00:45 GMT</pubDate><dc:creator>qq397472251</dc:creator><description>&lt;p&gt;thankyou&lt;/p&gt;</description></item><item><title>BatchUpdate issue</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BatchUpdate-issue/</link><pubDate>Sun, 19 Sep 2010 23:17:05 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Based on my test, you will need to set the datakeyfield of the grid during the PrepareDataBinding event handler, here is the snippet:&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)&lt;br /&gt;{&lt;br /&gt;    WebGrid1.RootTable.DataKeyField = "id";&lt;br /&gt;    WebGrid1.RetrieveStructure();&lt;br /&gt;    WebGrid1.RootTable.DataKeyField = "id";&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;You will also need to re-set the command during batch update event handler and invoke the RefreshAll client side method, here is the snippet:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_BatchUpdate(object sender, ISNet.WebUI.WebGrid.BatchUpdateEventArgs e)&lt;br /&gt;{&lt;br /&gt;    DataSet dt = (DataSet)WebGrid1.GetCachedDataSource();&lt;br /&gt;    DataSet changeDT = (DataSet)dt.GetChanges();&lt;br /&gt;&lt;br /&gt;    da = new SqlDataAdapter("SELECT  * FROM logintbl;", conn);&lt;br /&gt;    SqlCommandBuilder builder = new SqlCommandBuilder(da);&lt;br /&gt;&lt;br /&gt;    da.InsertCommand = builder.GetInsertCommand();&lt;br /&gt;    da.UpdateCommand = builder.GetUpdateCommand();&lt;br /&gt;    da.DeleteCommand = builder.GetDeleteCommand();&lt;br /&gt;&lt;br /&gt;    da.Update(changeDT);&lt;br /&gt;    WebGrid1.ClientAction.RefreshAll();&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>BatchUpdate issue</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BatchUpdate-issue/</link><pubDate>Sun, 19 Sep 2010 01:40:55 GMT</pubDate><dc:creator>qq397472251</dc:creator><description>&lt;p&gt;Can anyone help me? thanks&lt;/p&gt;</description></item><item><title>BatchUpdate issue</title><link>http://www.intersoftsolutions.com/Community/WebGrid/BatchUpdate-issue/</link><pubDate>Thu, 16 Sep 2010 23:54:27 GMT</pubDate><dc:creator>qq397472251</dc:creator><description>&lt;p&gt;&lt;span class="postusername"&gt;thank you&lt;a class="contentlink" href="http://www.intersoftpt.com/Community/Users/Glayaar/"&gt;&lt;span style="color: #165fa7; font-size: 15px"&gt;Glenn Layaar&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; .&lt;/p&gt;
&lt;p&gt;when BatchUpdate，care：&lt;br /&gt;1、set keyvalue&lt;/p&gt;
&lt;p&gt;2、get update insert delete   command &lt;br /&gt;&lt;br /&gt;May more people get it！&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>