Okay, well if I use the DataSource property for the DataGridView, then
I can access the DataRowView for the row and set the values. But it
doesn't solve my problem. If I click or tab away from the form, it
still clears the row.
Any other ideas?
-Dan
[quoted text, click to view] On Jan 23, 10:05 pm, "Daniel Manes" <danth...@cox.net> wrote:
> Cor,
>
> I see what you're getting at, but I'm not quite sure how to do this.
> The DataBoundItem property for the new row is apprently "Nothing." So I
> get a NullReferenceException if I try to set any values. It's as if the
> new row hasn't "registered" yet.
>
> Thanks,
>
> -Dan
>
> On Jan 23, 9:22 pm, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
> wrote:
>
> > Daniel,
>
> > As you use bounded data, than put your data in the source where your data is
> > in as you use Microsoft complex data controls.
>
> > Cor
>
> > "Daniel Manes" <danth...@cox.net> schreef in berichtnews:1169607826.959922.196160@j27g2000cwj.googlegroups.com...
>
> > > I'm trying to automatically enter some data into a row when the user
> > > first enters the row. So I created a RowEnter event handler that
> > > contains several statements like the following:
>
> > > _dataGrid.Rows(rowIndex).Cells(columnName).Value = newData
>
> > > When I do this, data actually shows up in the row when I click the row.
> > > But as soon as I tab away or click a button elsewhere on the form, the
> > > data vanishes.
>
> > > If I hand-enter the exact same data, I don't have this problem at all
> > > (I can click anywhere else on the form and the data remains).
>
> > > Anyone know what could be causing this?
>
> > > Thanks,
>
> > > -Dan
Daniel,
As you use bounded data, than put your data in the source where your data is
in as you use Microsoft complex data controls.
Cor
"Daniel Manes" <danthman@cox.net> schreef in bericht
news:1169607826.959922.196160@j27g2000cwj.googlegroups.com...
[quoted text, click to view] > I'm trying to automatically enter some data into a row when the user
> first enters the row. So I created a RowEnter event handler that
> contains several statements like the following:
>
> _dataGrid.Rows(rowIndex).Cells(columnName).Value = newData
>
> When I do this, data actually shows up in the row when I click the row.
> But as soon as I tab away or click a button elsewhere on the form, the
> data vanishes.
>
> If I hand-enter the exact same data, I don't have this problem at all
> (I can click anywhere else on the form and the data remains).
>
> Anyone know what could be causing this?
>
> Thanks,
>
> -Dan
>