HighTechTalks DotNet Forums  

DataGrid add new row into DataSet fails

Dotnet Framework (WinForms DataBinding) microsoft.public.dotnet.framework.windowsforms.databinding


Discuss DataGrid add new row into DataSet fails in the Dotnet Framework (WinForms DataBinding) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Tom Kreitinger
 
Posts: n/a

Default DataGrid add new row into DataSet fails - 09-02-2004 , 05:42 PM






Greetings,

I having a problem using a DataGrid and a DataSet to create a very simple
xml editor.
Everything works great except inserting a new row using the DataGrid GUI.

I set myDataGrid.DataSource = myDataSet and call myDataSet.ReadXml(
myXmlFile.xml );
Reading the xml file (above) creates one table in myDataSet.

The table displays great in myDataGrid and I can edit the data displayed
and save it by calling
myDataSet.WriteXml( myXmlFile.xml ). WriteXml is called for the following
events:
myDataSet.Tables[0].RowChanged
myDataSet.Tables[0].RowDeleted
myDataSet.Tables[0].ColumnChanged

Problem:

I can not get myDataGrid to insert successfully.
myDataGrid shows a blank line (last row of data) so I can click and add a
new row of data.
When I enter a new row of data, WriteXml is called but the new row of data
is not written to the xml file.
(I do not see it in the DataSet).

However, if I enter another (second) row (below the first) the first row of
data is written to the xml.

Maybe someone has a suggestions?

Thank you,
Tom




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.