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

Re: The amazing, vanishing programmatically-entered data in my DataGridView by Scott

Scott
Tue Jan 23 21:10:09 CST 2007

Did this really need to be cross-posted to all these newsgroups? Are you
writing this in C# or VB.NET because you posted to both newsgroups (among
others).


"Daniel Manes" <danthman@cox.net> wrote in message
news: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
>



Re: The amazing, vanishing programmatically-entered data in my DataGridView by Cor

Cor
Tue Jan 23 23:22:36 CST 2007

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...
> 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
>



Re: The amazing, vanishing programmatically-entered data in my DataGridView by Daniel

Daniel
Tue Jan 23 23:41:55 CST 2007

Hi Scott,

I didn't realize cross-posting was bad form. It seemed like my question
was relevant to all four groups, and it was not specific to VB.NET or
C#. I could see readers of any of those groups benefiting from any
answers I get, and I figured getting more people involved in the
discussion would be more likely to result in helpful answers. Please
tell me, What's wrong with that?

Thanks,

-Dan

On Jan 23, 7:10 pm, "Scott M." <s...@nospam.nospam> wrote:
> Did this really need to be cross-posted to all these newsgroups? Are you
> writing this in C# or VB.NET because you posted to both newsgroups (among
> others).
>
> "Daniel Manes" <danth...@cox.net> wrote in messagenews: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


Re: The amazing, vanishing programmatically-entered data in my DataGridView by Daniel

Daniel
Wed Jan 24 00:05:37 CST 2007

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


Re: The amazing, vanishing programmatically-entered data in my DataGridView by Daniel

Daniel
Wed Jan 24 00:28:49 CST 2007

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

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