PC Review


Reply
Thread Tools Rate Thread

Data grid inserting value using code

 
 
=?Utf-8?B?Smlt?=
Guest
Posts: n/a
 
      17th Aug 2004
I have a datagrid on a windows form that is filled using a data adapter and
dataset created in code. I have mapped columns to the various fields. The
user enters new infromation into the grid and then clicks a save button on
the toolbar to save the updated or new data. Two questions:

1. How do I let the user move directly from the row of newly inserted data
to the button and get the data to save. HasChanges does not recoginize the
row has changes unless we click in another row first.

2. I want to insert a specific value into one of the columns to be saved
with the changed column(s). I also need to know which row has the changes.

How do I accomplish this in vb.NET?

Thanks,
--
Jim
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      17th Aug 2004

>
> 1. How do I let the user move directly from the row of newly inserted data
> to the button and get the data to save. HasChanges does not recoginize the
> row has changes unless we click in another row first.


Probably one of the most asked questions in the dotNet newsgroups.
\\\as sample
BindingContext(ds.Tables(0)).EndCurrentEdit()
///
Before the test on haschanges by instance

> 2. I want to insert a specific value into one of the columns to be saved
> with the changed column(s). I also need to know which row has the changes.
>
> How do I accomplish this in vb.NET?


Every datarow has a rowstate, however you have to find those row while
looping throught the dataset.

http://msdn.microsoft.com/library/de...statetopic.asp

I hope this helps?

Cor


 
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
How to Add the Data grid and How to load the Grid? =?Utf-8?B?S2FydGhpa2V5YW4gUGVyaWFzYW15?= Microsoft Access Form Coding 3 2nd Jul 2007 03:02 PM
Grid View / Data Grid =?Utf-8?B?TWFyY28=?= Microsoft Access Forms 4 3rd May 2007 06:03 PM
give code details of data grid viewer in vb 2005 shashi Microsoft VB .NET 0 21st Apr 2006 11:06 AM
Most common approach to inserting/updating/deleting data using a grid John Microsoft ASP .NET 1 20th Feb 2006 03:48 PM
What code has the best performance to populate a Data Grid with a =?Utf-8?B?TWlrZSBM?= Microsoft C# .NET 8 28th Jul 2005 08:18 AM


Features
 

Advertising
 

Newsgroups
 


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