Hi Robin,
well, I call only CellValidating Event, but it is not implemented in this
moment. I don't understand why it is important?
The relevant piece of code is....
private void dataGridView1_DefaultValuesNeeded(object sender,
DataGridViewRowEventArgs e)
{
e.Row.Cells["TerminiGrupaID"].Value = listBox1.SelectedValue;
e.Row.Cells["Datum"].Value = now;
e.Row.Cells[0].Value = "12:00";
}
private void dataGridView1_CellValidating(object sender,
DataGridViewCellValidatingEventArgs e)
{
//if (dataGridView1.Columns[e.ColumnIndex].Name == "DoktorIme")
//{
// if (String.IsNullOrEmpty(e.FormattedValue.ToString()))
// {
// dataGridView1.Rows[e.RowIndex].ErrorText =
// "...";
// e.Cancel = true;
// }
//}
}
private void dataGridView1_RowLeave_1(object sender,
DataGridViewCellEventArgs e)
{
terminiAdapter.Update(terminiTable);
//dataGridView2.DataSource = terminiTable;
}
Ognjen
> Are you calling the EndEdit and Validate events before calling Update on
> your table adapter??
[quoted text clipped - 23 lines]
>>
>> Ognjen
RobinS - 19 Feb 2007 04:30 GMT
Are you using a BindingSource? You said you were, but then your code looks
like you're not. If you are, you need to call EndEdit to push the changes
down into your data source before saving the changes to the database.
Robin S.
-----------------------
> Hi Robin,
>
[quoted text clipped - 81 lines]
>>>
>>> Ognjen
Ogmios - 19 Feb 2007 11:14 GMT
I use binding source and I actually did call EndEdit before but it didn't
help?!?!
Now I use DataTable.Rows[index].EndEdit() and it helps.
I have tried all other combination including BindingSource.EndEdit(),
DataGridView.EndEdit() but this only that one works.
Thnx anyway
Ognjen
> Are you using a BindingSource? You said you were, but then your code looks
> like you're not. If you are, you need to call EndEdit to push the changes
[quoted text clipped - 87 lines]
>>>>
>>>> Ognjen