Can you switch to DataGridView? This appears to be fixed, as
demonstrable by adding the following to my last post:
(add the bottom of the ctor)
DataGridView dg = new DataGridView();
dg.Dock = DockStyle.Fill;
dg.DataSource = new SomeData[] { data };
Controls.Add(dg);
dg.BringToFront();
(add to the class)
protected override void OnClosing(CancelEventArgs e) {
e.Cancel = MessageBox.Show(this, data.Name + " : " +
data.Size, "Closing", MessageBoxButtons.OKCancel,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) ==
DialogResult.Cancel;
}
With DataGridView you see the new values in the message-box,
suggesting that updates and validation have occurred; with DataGrid
you get (as you posted) the old values.
Marc
schaf - 20 Jun 2007 13:06 GMT
> Can you switch to DataGridView?
No because I'm working on .NEt 1.1
But I have obtained help from the net and the easiest way to solve the
problem is to change the focus of the control in the Closing event.
Thanks
Marc Gravell - 20 Jun 2007 13:30 GMT
yes - same workaround as I am using for tool-strip
Marc