Page 1 of 1

DataGridView commit change immediately

Posted: Wed Feb 10, 2016 2: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 2:49 am
by noescape
Nevermind,

the solution is:

Code: Select all

$DGV_CurrentCellDirtyStateChanged={
if ($DGV.IsCurrentCellDirty)
{
$DGV.CommitEdit([System.Windows.Forms.DataGridViewDataErrorContexts]::Commit)
}

}

Re: DataGridView commit change immediately

Posted: Wed Feb 10, 2016 11: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.