473,396 Members | 2,013 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,396 software developers and data experts.

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

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 1300
Hi,

Post your code.

Ken
---------------------
"Aaron Ackerman" <no@spam.com> wrote in message
news:%2****************@tk2msftngp13.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.EventArgs) Handles txtConLastName.LostFocus

Try ' Set up structured error handling.
vdsClientUI.ContactByID.Rows(dgContacts.CurrentRow Index).Item("PersonLastNam
e") = Me.txtConLastName.Text
objClient.UpdateContactByID(Me.vdsClientUI, "ContactByID")
RefreshContactsGrid()
Catch ex As Exception ' Catch the error.
Me.blnErrorLogged = ErrorLog(ex.ToString) 'Log Error in DB
MsgBox(ex.ToString) 'Show friendly error message.
Me.Close() 'Close Form
Finally
' Beep after error processing.
End Try
End Sub
Private Sub RefreshContactsGrid()
Try ' Set up structured error handling.
Me.dgContacts.DataBindings.Clear()
vdsClientUI.Tables("ContactSelectAll").Clear()
vdsClientUI.Tables("ContactSelectAll").Dispose()

vdsClientUI.Tables("ContactByID").Clear()
vdsClientUI.Tables("ContactByID").Dispose()
'Me.dgContacts.Refresh()
vdsClientUI = objClient.selContacts(intClientID,
Me.strEmploymentConsultantSSN)
Me.dgContacts.SetDataBinding(vdsClientUI, "ContactSelectAll")
Me.dgContacts.DataBindings.Clear()

vdsClientUI = objClient.selContactByID(intClientID,
Me.strEmploymentConsultantSSN)
Catch ex As Exception ' Catch the error.
Me.blnErrorLogged = ErrorLog(ex.ToString) 'Log Error in DB
MsgBox(ex.ToString) 'Show friendly error message.
Me.Close() 'Close Form
'Application.ExitThread() 'Exit App
Finally
' Beep after error processing.
End Try

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

Post your code.

Ken
---------------------
"Aaron Ackerman" <no@spam.com> wrote in message
news:%2****************@tk2msftngp13.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
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...
0
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...
2
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...
4
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...
1
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...
5
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....
0
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...
1
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...
9
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
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,...

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.