PC Review


Reply
Thread Tools Rate Thread

The amazing, vanishing programmatically-entered data in my DataGridView

 
 
Daniel Manes
Guest
Posts: n/a
 
      24th Jan 2007
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

 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      24th Jan 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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      24th Jan 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" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Daniel Manes
Guest
Posts: n/a
 
      24th Jan 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:(E-Mail Removed)...
>
> > 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


 
Reply With Quote
 
Daniel Manes
Guest
Posts: n/a
 
      24th Jan 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:(E-Mail Removed)...

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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Macro in Excel 2004 to move entered data from one sheet toanother and space between rows when next data is entered? bella.sandi@gmail.com Microsoft Excel Programming 1 4th Jun 2008 05:08 PM
The amazing, vanishing programmatically-entered data in my DataGridView Daniel Manes Microsoft C# .NET 4 24th Jan 2007 06:28 AM
The amazing, vanishing programmatically-entered data in my DataGridView Daniel Manes Microsoft Dot NET Framework Forms 5 24th Jan 2007 06:28 AM
The Amazing Vanishing Task...Appointment...Thing =?Utf-8?B?Umlhbm5l?= Microsoft Outlook Discussion 0 17th Mar 2006 09:18 PM
Amazing Vanishing Form--Help =?Utf-8?B?ci4gaG93ZWxs?= Microsoft Access Forms 4 10th Oct 2005 04:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:54 AM.