{"id":390,"date":"2013-08-13T16:08:20","date_gmt":"2013-08-13T20:08:20","guid":{"rendered":"http:\/\/binaryworld.net\/blogs\/?p=390"},"modified":"2013-08-13T16:09:06","modified_gmt":"2013-08-13T20:09:06","slug":"how-to-show-delete-confirmation-in-lightswitch","status":"publish","type":"post","link":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/","title":{"rendered":"How to show delete confirmation in LightSwitch"},"content":{"rendered":"<p>If you want to ask user before deleting record then write the following code in your screen code editor.<\/p>\n<pre class=\"brush: vbnet; gutter: true; first-line: 1; highlight: []; html-script: false\">\r\nNamespace LightSwitchApplication\r\n\r\n    Public Class EditableCustomersGrid\r\n\r\n        Private Sub gridDeleteSelected_Execute()\r\n            &#039; Write your code here.\r\n            If ShowMessageBox(&quot;Are you sure you want to delete this record?&quot;, &quot;Confirm Delete&quot;, MessageBoxOption.YesNo) = MessageBoxResult.Yes Then\r\n                Dim cust As Customer\r\n                cust = Me.Customers.SelectedItem\r\n                If Customers.CanDelete Then\r\n                    cust.Delete()\r\n                    Me.Save() &#039;\/\/Save immediately ..\r\n                End If\r\n            End If\r\n        End Sub\r\n    End Class\r\n\r\nEnd Namespace\r\n<\/pre>\n<p><a href=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg\" alt=\"\" title=\"lightswitch-row-delete-confirm\" width=\"398\" height=\"249\" class=\"alignnone size-full wp-image-391\" srcset=\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg 398w, https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm-300x187.jpg 300w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to ask user before deleting record then write the following code in your screen code editor. Namespace LightSwitchApplication Public Class EditableCustomersGrid Private Sub gridDeleteSelected_Execute() &#039; Write your code here. If ShowMessageBox(&quot;Are you sure you want to delete &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/\"> <span class=\"screen-reader-text\">How to show delete confirmation in LightSwitch<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":391,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49,76,65],"tags":[162,50],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>How to show delete confirmation in LightSwitch - BinaryWorld Blog<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"How to show delete confirmation in LightSwitch - BinaryWorld Blog\" \/>\r\n<meta property=\"og:description\" content=\"If you want to ask user before deleting record then write the following code in your screen code editor. Namespace LightSwitchApplication Public Class EditableCustomersGrid Private Sub gridDeleteSelected_Execute() &#039; Write your code here. If ShowMessageBox(&quot;Are you sure you want to delete &hellip; How to show delete confirmation in LightSwitch Read More &raquo;\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/\" \/>\r\n<meta property=\"og:site_name\" content=\"BinaryWorld Blog\" \/>\r\n<meta property=\"article:published_time\" content=\"2013-08-13T20:08:20+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2013-08-13T20:09:06+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg\" \/>\r\n\t<meta property=\"og:image:width\" content=\"398\" \/>\r\n\t<meta property=\"og:image:height\" content=\"249\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\r\n<meta name=\"author\" content=\"Binary World\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Binary World\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/\",\"url\":\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/\",\"name\":\"How to show delete confirmation in LightSwitch - BinaryWorld Blog\",\"isPartOf\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg\",\"datePublished\":\"2013-08-13T20:08:20+00:00\",\"dateModified\":\"2013-08-13T20:09:06+00:00\",\"author\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0\"},\"breadcrumb\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#primaryimage\",\"url\":\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg\",\"contentUrl\":\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg\",\"width\":\"398\",\"height\":\"249\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/binaryworld.net\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to show delete confirmation in LightSwitch\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/#website\",\"url\":\"https:\/\/binaryworld.net\/blogs\/\",\"name\":\"BinaryWorld Blog\",\"description\":\"Tips and Tutorials for Microsoft SQL Server, SSIS, SSAS, Business Intelligence, C#, .net\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/binaryworld.net\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0\",\"name\":\"Binary World\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g\",\"caption\":\"Binary World\"},\"description\":\"Binary World is a Software Development company located in Atlanta, USA (since 2007). Binary World specialized in Business Intelligence, mobile, cloud computing and .Net Application Development.\",\"url\":\"https:\/\/binaryworld.net\/blogs\/author\/admin\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to show delete confirmation in LightSwitch - BinaryWorld Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/","og_locale":"en_US","og_type":"article","og_title":"How to show delete confirmation in LightSwitch - BinaryWorld Blog","og_description":"If you want to ask user before deleting record then write the following code in your screen code editor. Namespace LightSwitchApplication Public Class EditableCustomersGrid Private Sub gridDeleteSelected_Execute() &#039; Write your code here. If ShowMessageBox(&quot;Are you sure you want to delete &hellip; How to show delete confirmation in LightSwitch Read More &raquo;","og_url":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/","og_site_name":"BinaryWorld Blog","article_published_time":"2013-08-13T20:08:20+00:00","article_modified_time":"2013-08-13T20:09:06+00:00","og_image":[{"width":"398","height":"249","url":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg","type":"image\/jpeg"}],"author":"Binary World","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Binary World"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/","url":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/","name":"How to show delete confirmation in LightSwitch - BinaryWorld Blog","isPartOf":{"@id":"https:\/\/binaryworld.net\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#primaryimage"},"image":{"@id":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#primaryimage"},"thumbnailUrl":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg","datePublished":"2013-08-13T20:08:20+00:00","dateModified":"2013-08-13T20:09:06+00:00","author":{"@id":"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0"},"breadcrumb":{"@id":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#primaryimage","url":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg","contentUrl":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/08\/lightswitch-row-delete-confirm.jpg","width":"398","height":"249"},{"@type":"BreadcrumbList","@id":"https:\/\/binaryworld.net\/blogs\/how-to-show-delete-confirmation-in-lightswitch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/binaryworld.net\/blogs\/"},{"@type":"ListItem","position":2,"name":"How to show delete confirmation in LightSwitch"}]},{"@type":"WebSite","@id":"https:\/\/binaryworld.net\/blogs\/#website","url":"https:\/\/binaryworld.net\/blogs\/","name":"BinaryWorld Blog","description":"Tips and Tutorials for Microsoft SQL Server, SSIS, SSAS, Business Intelligence, C#, .net","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/binaryworld.net\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0","name":"Binary World","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g","caption":"Binary World"},"description":"Binary World is a Software Development company located in Atlanta, USA (since 2007). Binary World specialized in Business Intelligence, mobile, cloud computing and .Net Application Development.","url":"https:\/\/binaryworld.net\/blogs\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/posts\/390"}],"collection":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/comments?post=390"}],"version-history":[{"count":0,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/posts\/390\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/media\/391"}],"wp:attachment":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/media?parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/categories?post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/tags?post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}