Hi Trey,
When are you updating to database?
--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com
I tried this but when I did an update and accept changes the data never
appeared to get in the database. What could I be doing wrong?
Thanks,
"Miha Markic" <miha at rthand com> wrote in message
Hi Trey,
Try something like:
private void dataGrid1_CurrentCellChanged(object sender,
System.EventArgs
e)
{
if (dataGrid1.CurrentCell.RowNumber == sourceTable.Rows.Count)
{
BindingManagerBase bmb = dataGrid1.BindingContext[sourceTable];
DataRowView drv = (DataRowView)bmb.Current;
drv["Field"] = "DefaultValue";
}
}
In the if part I look if I am positioned in a new row (where rownumber
exceeds the rows in source table)
Then I simply find the BindingManagerBase responsible for grid and
inserts
default value.
This method requires one slight modification though - it will fire
whenever
user clicks in same new row - so you'll need to add a flag or something.
--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com
I am working on a Windows Application with a Grid. When someone
starts
a
new Row by entering selecting the empty row I need to put some default
information in the cells. The data is actually a date and time stamp
for
the entry.
But I can't find an event to tell me when a new row is created