473,608 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid does not work correctly when selecting item to fill controls and refreshing...HE LP???

I have been having just on going problems with my MS Datagrids. I have NO
idea what I am doing wrong.

What is esentially happening is that say I have three records in my Dataset.
I click on the third row to populate the textboxes below the grid that
correspond to the various columns in the grid. The textboxes fill. I edit
the data in one of the textboxes. As I lose focus I update the dataset and
refresh the grid.

Well the third row refreshes just fine. But I also fine that the first row
in my dataset also gets updates WITH ALL OF THE DATA FROM THE THIRD ROW??? I
have traced the dataset all through the update and cannot for the life of me
see where this happens. It seems to happen behind the scenes somewhere
through the databinding.

Anyway it is driving me nuts. Any ideas.
Nov 20 '05 #1
2 1309
Hi,

Post your code.

Ken
---------------------
"Aaron Ackerman" <no@spam.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I have been having just on going problems with my MS Datagrids. I have NO
idea what I am doing wrong.

What is esentially happening is that say I have three records in my
Dataset.
I click on the third row to populate the textboxes below the grid that
correspond to the various columns in the grid. The textboxes fill. I edit
the data in one of the textboxes. As I lose focus I update the dataset and
refresh the grid.

Well the third row refreshes just fine. But I also fine that the first row
in my dataset also gets updates WITH ALL OF THE DATA FROM THE THIRD ROW???
I
have traced the dataset all through the update and cannot for the life of
me
see where this happens. It seems to happen behind the scenes somewhere
through the databinding.

Anyway it is driving me nuts. Any ideas.

Nov 20 '05 #2
Private Sub txtConLastName_ LostFocus(ByVal sender As Object, ByVal e As
System.EventArg s) Handles txtConLastName. LostFocus

Try ' Set up structured error handling.
vdsClientUI.Con tactByID.Rows(d gContacts.Curre ntRowIndex).Ite m("PersonLastNa m
e") = Me.txtConLastNa me.Text
objClient.Updat eContactByID(Me .vdsClientUI, "ContactByI D")
RefreshContacts Grid()
Catch ex As Exception ' Catch the error.
Me.blnErrorLogg ed = ErrorLog(ex.ToS tring) 'Log Error in DB
MsgBox(ex.ToStr ing) 'Show friendly error message.
Me.Close() 'Close Form
Finally
' Beep after error processing.
End Try
End Sub
Private Sub RefreshContacts Grid()
Try ' Set up structured error handling.
Me.dgContacts.D ataBindings.Cle ar()
vdsClientUI.Tab les("ContactSel ectAll").Clear( )
vdsClientUI.Tab les("ContactSel ectAll").Dispos e()

vdsClientUI.Tab les("ContactByI D").Clear()
vdsClientUI.Tab les("ContactByI D").Dispose( )
'Me.dgContacts. Refresh()
vdsClientUI = objClient.selCo ntacts(intClien tID,
Me.strEmploymen tConsultantSSN)
Me.dgContacts.S etDataBinding(v dsClientUI, "ContactSelectA ll")
Me.dgContacts.D ataBindings.Cle ar()

vdsClientUI = objClient.selCo ntactByID(intCl ientID,
Me.strEmploymen tConsultantSSN)
Catch ex As Exception ' Catch the error.
Me.blnErrorLogg ed = ErrorLog(ex.ToS tring) 'Log Error in DB
MsgBox(ex.ToStr ing) 'Show friendly error message.
Me.Close() 'Close Form
'Application.Ex itThread() 'Exit App
Finally
' Beep after error processing.
End Try

End Sub
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:eQ******** ******@TK2MSFTN GP11.phx.gbl...
Hi,

Post your code.

Ken
---------------------
"Aaron Ackerman" <no@spam.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I have been having just on going problems with my MS Datagrids. I have NO
idea what I am doing wrong.

What is esentially happening is that say I have three records in my
Dataset.
I click on the third row to populate the textboxes below the grid that
correspond to the various columns in the grid. The textboxes fill. I edit the data in one of the textboxes. As I lose focus I update the dataset and refresh the grid.

Well the third row refreshes just fine. But I also fine that the first row in my dataset also gets updates WITH ALL OF THE DATA FROM THE THIRD ROW??? I
have traced the dataset all through the update and cannot for the life of me
see where this happens. It seems to happen behind the scenes somewhere
through the databinding.

Anyway it is driving me nuts. Any ideas.


Nov 20 '05 #3

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

Similar topics

3
4867
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
0
2397
by: mike | last post by:
Hi there: I've read an excellent "how to"-article by Microsoft (no. 306227) - partly cited cited at the end of this email). I have implemented the code related to the part "How to Add a CheckBox Programmatically" in my code. I have changed it to use a OLDDB.DBReader to populate the datagrid and for the databinding. It works perfectly - also when using the edit-mode in the datagrid.
2
1417
by: Roy | last post by:
I am very, very new to ASP.NEt and have never done ASP. I have been trying to get a datagrid to work for about 5 days with very limited results. When I use property builder, bind the control, set the paging and populate it from the page_load event it works. However, if I set it as unbound, then set the properties through code the grid does not show. I check the dataset count and there are 43 rows. My first question is "Can a datagrid...
4
2115
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated Datagrid in a Web Custom Control (WCC) : The datagrid has LinkButton Column which has a select LinkButton for each row. When this button is clicked, the Datagrid raises its 'ItemCommand' event which captures the information for that row and...
1
3774
by: Harry Devine | last post by:
I have a DataGrid that is configured to use the Edit/Update/Cancel concept correctly. My grid shows values from 5 database fields. I only need to update that last 4 fields. The last field is a Yes/No value in Access. Using the OleDbCommand, if I do not consider the Yes/No field, the ExecuteNonQuery command, using my UPDATE SQL statement, updates the record correctly. However, if I put the Yes/No field into the mix, ExecuteNonQuery...
5
1861
by: Hennie | last post by:
When trying to update a record in an editable datagrid I ran into a few problems. My update procedure is just not working. Can someone please have a look at my code and see what am I doing wrong. I had to set the datagrid's DataKeyField to MailSubscriberID manually since vs does not do it automatically. Thanks
0
1821
by: Daniel Doyle | last post by:
Hello and apologies in advance for the amount of code in this post. I've also sent this message to the Sharepoint group, but thought that ASP.NET developers may also be able to help, even though it's a Sharepoint WebPart. I'm trying to do something fairly simple, create a datagrid that displays where and when a person works and allows them to change some of the information via DropDownLists. When the user clicks to edit a row, three of...
1
4225
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get the example to work. I created the following two classes, provided with the example: *-*-**-*-*-*-*-*-*-*-*-*-**-*-*-*-*-CheckBoxColumn Class:-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-**-*-*-*
9
2713
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
0
8059
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8495
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8470
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6815
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6011
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5475
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4023
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1328
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.