Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2007

Tip: Looking for answers? Try searching our database.

The amazing, vanishing programmatically-entered data in my DataGridView

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel Manes - 24 Jan 2007 03:03 GMT
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
Scott M. - 24 Jan 2007 03:10 GMT
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).

> 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
[quoted text clipped - 14 lines]
>
> -Dan
Daniel Manes - 24 Jan 2007 05:41 GMT
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

> 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
[quoted text clipped - 18 lines]
>
> > -Dan
Cor Ligthert [MVP] - 24 Jan 2007 05:22 GMT
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

> 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
[quoted text clipped - 14 lines]
>
> -Dan
Daniel Manes - 24 Jan 2007 06:05 GMT
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,
>
[quoted text clipped - 21 lines]
>
> > -Dan
Daniel Manes - 24 Jan 2007 06:28 GMT
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

> Cor,
>
[quoted text clipped - 35 lines]
>
> > > -Dan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.