Support Forums

DataGridView commit change immediately

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.
User avatar
noescape
Posts: 16
Joined: Wed Apr 22, 2015 4:57 am

DataGridView commit change immediately

Postby noescape » Wed Feb 10, 2016 2:34 am

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
User avatar
noescape
Posts: 16
Joined: Wed Apr 22, 2015 4:57 am

Re: DataGridView commit change immediately

Postby noescape » Wed Feb 10, 2016 2:49 am

Nevermind,

the solution is:

$DGV_CurrentCellDirtyStateChanged={
if ($DGV.IsCurrentCellDirty)
{
$DGV.CommitEdit([System.Windows.Forms.DataGridViewDataErrorContexts]::Commit)
}
 
}
User avatar
DevinL
Site Admin
Posts: 733
Joined: Mon Aug 17, 2015 2:25 pm

Re: DataGridView commit change immediately

Postby DevinL » Wed Feb 10, 2016 11:18 am

[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.
DevinL
SAPIEN Technologies, Inc.

Return to “PowerShell GUIs”

Who is online

Users browsing this forum: No registered users and 7 guests

cron