{"id":639,"date":"2011-03-31T10:30:11","date_gmt":"2011-03-31T14:30:11","guid":{"rendered":"http:\/\/www.iowawebnet.com\/ein\/?p=639"},"modified":"2011-03-31T10:30:11","modified_gmt":"2011-03-31T14:30:11","slug":"one-click-gridview-record-update","status":"publish","type":"post","link":"https:\/\/www.iowawebnet.com\/ein\/2011\/03\/one-click-gridview-record-update\/","title":{"rendered":"One click gridview record update"},"content":{"rendered":"<p>Here is how you can update record in a gridview with just a one click.<\/p>\n<p><a rel=\"attachment wp-att-640\" href=\"http:\/\/www.iowawebnet.com\/ein\/?attachment_id=640\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-640\" title=\"Gridview record updagte\" src=\"http:\/\/www.iowawebnet.com\/ein\/wp-content\/uploads\/2011\/03\/ScreenShot007.gif\" alt=\"\" width=\"716\" height=\"164\" srcset=\"https:\/\/www.iowawebnet.com\/ein\/wp-content\/uploads\/2011\/03\/ScreenShot007.gif 716w, https:\/\/www.iowawebnet.com\/ein\/wp-content\/uploads\/2011\/03\/ScreenShot007-300x68.gif 300w\" sizes=\"(max-width: 716px) 100vw, 716px\" \/><\/a><\/p>\n<p><strong>Code:<\/strong><\/p>\n<p>&lt;asp:TemplateField HeaderText=&#8221;Active&#8221;&gt;<br \/>\n&lt;ItemTemplate&gt;<br \/>\n&lt;asp:CheckBox ID=&#8221;ActiveCheckBox&#8221; runat=&#8221;server&#8221; Checked='&lt;%# Bind(&#8220;Active&#8221;) %&gt;&#8217; \/&gt;<br \/>\n&lt;asp:LinkButton ID=&#8221;UpdateButton&#8221; runat=&#8221;server&#8221; CausesValidation=&#8221;True&#8221; CommandName=&#8221;Update&#8221; Text=&#8221;Update&#8221; \/&gt;<br \/>\n&lt;\/ItemTemplate&gt;<br \/>\n&lt;HeaderStyle CssClass=&#8221;datagrid-th&#8221; \/&gt;<br \/>\n&lt;\/asp:TemplateField&gt;<\/p>\n<p><strong>Access Data Source<\/strong><\/p>\n<p>&lt;asp:AccessDataSource ID=&#8221;RepoMgt&#8221; runat=&#8221;server&#8221; DataFile=&#8221;\/my_folder\/mydb.mdb&#8221;<br \/>\nDeleteCommand=&#8221;DELETE FROM [MyCars] WHERE [ID] = ?&#8221;<br \/>\nInsertCommand=&#8221;INSERT INTO [MyCars] ([Active]) VALUES (?)&#8221;<br \/>\nSelectCommand=&#8221;SELECT * FROM [MyCars] ORDER BY [Make], [Model]&#8221;<br \/>\n<span style=\"color: #0000ff;\">UpdateCommand=&#8221;UPDATE [MyCars] SET [Active] = ? WHERE [ID] = ?&#8221;<\/span> &gt;<\/p>\n<p><strong>Update Parameters<\/strong><\/p>\n<p>&lt;UpdateParameters&gt;<br \/>\n&lt;asp:Parameter Name=&#8221;Active&#8221; Type=&#8221;Boolean&#8221; \/&gt;<br \/>\n&lt;asp:Parameter Name=&#8221;ID&#8221; Type=&#8221;Int32&#8243; \/&gt;<br \/>\n&lt;\/UpdateParameters&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is how you can update record in a gridview with just a one click. Code: &lt;asp:TemplateField HeaderText=&#8221;Active&#8221;&gt; &lt;ItemTemplate&gt; &lt;asp:CheckBox ID=&#8221;ActiveCheckBox&#8221; runat=&#8221;server&#8221; Checked='&lt;%# Bind(&#8220;Active&#8221;) %&gt;&#8217; \/&gt; &lt;asp:LinkButton ID=&#8221;UpdateButton&#8221; runat=&#8221;server&#8221; CausesValidation=&#8221;True&#8221; CommandName=&#8221;Update&#8221; Text=&#8221;Update&#8221; \/&gt; &lt;\/ItemTemplate&gt; &lt;HeaderStyle CssClass=&#8221;datagrid-th&#8221; \/&gt; &lt;\/asp:TemplateField&gt; Access Data Source &lt;asp:AccessDataSource ID=&#8221;RepoMgt&#8221; runat=&#8221;server&#8221; DataFile=&#8221;\/my_folder\/mydb.mdb&#8221; DeleteCommand=&#8221;DELETE FROM [MyCars] WHERE [ID] = ?&#8221; InsertCommand=&#8221;INSERT INTO [MyCars] [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,17,16],"tags":[19,42,45],"class_list":["post-639","post","type-post","status-publish","format-standard","hentry","category-access","category-applications","category-net","tag-asp-net","tag-gridview","tag-record-update"],"_links":{"self":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/639"}],"collection":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/comments?post=639"}],"version-history":[{"count":11,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/639\/revisions"}],"predecessor-version":[{"id":651,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/639\/revisions\/651"}],"wp:attachment":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/media?parent=639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/categories?post=639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/tags?post=639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}