473,387 Members | 1,687 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,387 software developers and data experts.

Binding a datagrid to a dataset

Hello,
I have a problem whereby I have datagrid bound to a dataset with the following properties
I have put a similar problem up b4 but I still do not have an answer.

MyDatagrid.DataSource = Mydatase
MyDatagrid.DataMember = "Orders
MyDatagrid.SetDataBinding(Mydataset, "Orders"

I wish to update the backend dataset when the user makes a change to the dataset.My problem is that the
dataset does not recognise a change until the user clicks on the next row of the datagrid, except when th
user is on the first row of the datagrid

therefore in the MyDatagrid_currentcellchanged event I have the following code

Private Sub MyDataGrid_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Mydatagrid.CurrentCellChange
DirectCast(BindingContext(Mydataset.Tables("Orders ")), CurrencyManager).EndCurrentEdit(

If MyDataset.HasChanges The

Dim Mydataaccess As New DataAccess.DataAcces
Call Mydataaccess.UpdateDataSet(Mydataset, MyMetalWorkAdapter, "Metalwork"
End I

End I
End Su

My problem is that the Mydataset.HasChanges condition is only true after the user makes a change and then clicks on the nex
row of the grid, EXCEPT when on the first row of the grid, then Mydataset.haschanges = true on changing an individual colum

Does anyone know why this is happening, or how to resolve it so that updates are performed immediately upon changing a column, you can't expect the use
to click on the next row each time they make a change. Does anyone have a sample of a vb program whereby a datagrid is updated against a backend database
I can't imagine that this is such a rare occurrence

Thanx in Advanc

Geraldine
Nov 20 '05 #1
0 783

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

Similar topics

0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
1
by: J | last post by:
This works well for binding a Dataset (created from an XML file) to a DataGrid for the entire 'page' table. However I would like to only grab a few rows from the 'page' table (like: select id,...
5
by: Jason Huang | last post by:
Hi, Is it possible to bind DataReader to a DataGrid in C# windows form? And how? And can we update data in a DataSet by using the DataReader? Thanks for help. Jason
0
by: GrumpyDev | last post by:
Hi. My question is regarding binding a DataSet to a DataGrid. When I change Caption property of all column in my dataset and then bind dataset to a DataGrid, new caption aren't displayed in a grid...
2
by: Chris Kennedy | last post by:
I have two datagrids on a page. On the update event of the first I take some of the selected data, create a dataset and add it and then bind it to the second datagrid. If I hit update several...
2
by: Andrew Robinson | last post by:
Is there any way to accomplish two way data binding in a Details View with a DataSet or DataTable as the DataSource. All I want is to get an updated DataSet or DataTable back from the...
8
by: Richard L Rosenheim | last post by:
I have a dataset containing a parent table related to a child table. The child table contains an ID field (which is configured as autonumber in the datatable), the ID of the parent, plus some...
6
by: p.mc | last post by:
Hi all, I'm having major problems with a userControl which contains a datagrid. My problem concerns data binding. The Page_Load() procedure calls the DataBind procedure to bind the datagrid...
3
by: no | last post by:
Hi all, I have a dataset that contain 2 tables and a relationship between them (master detail). I bind this dataset to a form that include some textboxes that bind to the parent record, and a...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
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...

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.