473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Hidden data addition

Hello,

I was wondering if anyone could tell me a good way to add data to a datagrid
(or it's dataset) when the user edits/adds a record in a datagrid.

Basically, I want to be able to add a username / timestamp to a record, I'm
sure there are plenty of ways to do this, but I'm sure it's been done before
and was wondering if anyone had any good proceedures they use, since I've
started using datagrids more frequently.

Thanks In Advance,
Eric Dreksler
Nov 20 '05 #1
3 901
Hi Eric,

When we are talking about data processing than the starndaard datasource of
a datagrid is/are datatable(s). (Can by using the dataview however it stays
the datatable)

You can add as much datacolumns to a datatable as you wish however than you
should use the datagridtablestyles to show the proper colums in the
datagrid.

You can as well declare the datatable withevents which means that you can by
instance use the datatable row changed event to do updating as you say.

Just some idea's

Cor

I was wondering if anyone could tell me a good way to add data to a datagrid (or it's dataset) when the user edits/adds a record in a datagrid.

Basically, I want to be able to add a username / timestamp to a record, I'm sure there are plenty of ways to do this, but I'm sure it's been done before and was wondering if anyone had any good proceedures they use, since I've
started using datagrids more frequently.

Thanks In Advance,
Eric Dreksler

Nov 20 '05 #2
All right,
I have my datagrid setup (and I'm using a DataTable), however I can't seem
to figure out how to get the RowChanging and RowChanged events to work for
me.

On RowChanging, it won't let me change a row marked for updating. And on
RowChanged, if I try to update the e.Row arguement it sends me into a loop
(continually calling the RowChanged Event), until it just crashes out.
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:e7**************@TK2MSFTNGP12.phx.gbl...
Hi Eric,

When we are talking about data processing than the starndaard datasource of a datagrid is/are datatable(s). (Can by using the dataview however it stays the datatable)

You can add as much datacolumns to a datatable as you wish however than you should use the datagridtablestyles to show the proper colums in the
datagrid.

You can as well declare the datatable withevents which means that you can by instance use the datatable row changed event to do updating as you say.

Just some idea's

Cor

I was wondering if anyone could tell me a good way to add data to a

datagrid
(or it's dataset) when the user edits/adds a record in a datagrid.

Basically, I want to be able to add a username / timestamp to a record,

I'm
sure there are plenty of ways to do this, but I'm sure it's been done

before
and was wondering if anyone had any good proceedures they use, since I've started using datagrids more frequently.

Thanks In Advance,
Eric Dreksler


Nov 20 '05 #3
Hi Eric,

I thought something as this (however I am not very sure, the endedit did
throw an error, but it was not needed for this sample, it is more said in
this newsgroup, that this event is not the best part of the framework)

However, I hope it helps?

Cor

\\\
Dim bool As Boolean
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
'to make the sample table
dt.Columns.Add("col1")
dt.Columns.Add("col2")
For i As Integer = 0 To 5
Dim dr As DataRow = dt.NewRow
dr(0) = i.ToString
dt.Rows.Add(dr)
Next
DataGrid1.DataSource = dt
bool = True
End Sub

Private Sub dt_RowChanged(ByVal sender As Object, _
ByVal e As System.Data.DataRowChangeEventArgs) _
Handles dt.RowChanged
e.Row.BeginEdit()
If bool Then
e.Row(1) = e.Row(0)
End If
End Sub
///
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
8
by: Matt Herson | last post by:
I have been trying to find a way to use JavaScript to change the value of a hidden field on submit. I am already invoking a JavaScript to handle the validation on submit. The reason I need to...
7
by: Eduard Dewolf | last post by:
Hi, Im have been changing my site to make it HTML 4.01 compliant As I should, I wrapped all INPUT tags in blocks I wrapped the not visible INPUT type HIDDEN tags in first PRE, later H6 tags...
9
by: Randell D. | last post by:
Folks, I have a large amount of values to store (we're talking tens, if not hundreds of bytes). I need this for a client side application - ignore the security consequences for the moment -...
6
by: Omar | last post by:
Hi, In a JSP I have the next: .... codigo = "<select name='" + nombre + "'>\n<option selected value='default'>Escoge</option><option value='todos'>Todos</option>"; if (miRS != null) while...
351
by: CBFalconer | last post by:
We often find hidden, and totally unnecessary, assumptions being made in code. The following leans heavily on one particular example, which happens to be in C. However similar things can (and...
18
by: Joel Hedlund | last post by:
Hi! The question of type checking/enforcing has bothered me for a while, and since this newsgroup has a wealth of competence subscribed to it, I figured this would be a great way of learning...
2
by: Bill Steele | last post by:
I want to have a window pop up with a form. When the form is submitted, it needs to pass along the URL of the original window. If find on th web eight gazillion descriptions of how to pass data...
1
by: pemigh | last post by:
I'm almost done with an application, and trying to lock it down tightly. But I still want users to be able to point to a new location for the data file. The code below fires off to detect and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.