In my grid, If I edit a cell, then click on another cell, the AfterRowUpdate event fires as I would expect. But if I edit a cell, then click a close button, the AfterRowUpdate event does not fire. How could I get the close button to do the same thing as clicking on another cell.
For example, if I change the text in cell A2 and then click on cell B2, then click my close button the AfterRowUpdate event fires and asks if I want to save changes. But if I change the text in cell A2 and then immediately click the close button the AfterRowUpdate event does not fire and my changes aren't saved.
Thanks,
Rich
Thanks this worked. I made another post now but I'll tell you here in case you don't see it.
I want to do this update, then tell the user that changes exist and prompt them for saving
or discarding. If they don't want to save the changes, I want to rollback/cancel this UpdateData()
call.
Something like this:
ultraGrid1.UpdateData();
DialogResult Dr = MessageBox.Show("Save Changes?")
if Dr = Windows.Forms.DialogResult.No
{
// Rollback / Cancel UpdateData()
}
Is that possible?
Thanks
grid leave event wont work it you close the form using the x button :)
You can even use grid Leave Event..
Private Sub UltraGrid_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles UltraGrid.Leave
UltraGrid.UpdateData()
End Sub
Regards,
Janani,
Software Engineer,
Hirotec India Ltd.
private void Form1_FormClosing(object sender, FormClosingEventArgs e)