Page 1 of 1

DataGridView commit change immediately

Posted: Wed Feb 10, 2016 1:34 am
by noescape
Product, version and build: PowerShell Studio 2015 Version 4.2.83
32 or 64 bit version of product: 64bit
Operating system: Win8.1 64bit

Hi,

I'm interested in the option of commiting changes to any cell inside a DataGridView without ending the edit mode.
I've found some options for C# and other languages but I was unable to make it work in PS Studio.

Thanks for help,

Thomas

Re: DataGridView commit change immediately

Posted: Wed Feb 10, 2016 1:49 am
by noescape
Nevermind,

the solution is:
  1. $DGV_CurrentCellDirtyStateChanged={
  2.     if ($DGV.IsCurrentCellDirty)
  3.     {
  4.         $DGV.CommitEdit([System.Windows.Forms.DataGridViewDataErrorContexts]::Commit)
  5.     }
  6.    
  7. }

Re: DataGridView commit change immediately

Posted: Wed Feb 10, 2016 10:18 am
by DevinL
[POST MOVED TO THE POWERSHELL GUI FORUM BY MODERATOR]

Glad to know you figured it out.

I moved this post to the PowerShell GUI forums in case anyone else would like this for future reference.