Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

DataGridView Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Taoge - 29 Jul 2006 15:16 GMT
DataGridView bind to DataSet which read data from a XML file, when I edit
the cell value and save back, it's ok; but when change the cell value
programmaticlly, the value can not save back to XML file.

Help , please!
Carl Daniel [VC++ MVP] - 29 Jul 2006 15:22 GMT
> DataGridView bind to DataSet which read data from a XML file, when I
> edit the cell value and save back, it's ok; but when change the cell
> value programmaticlly, the value can not save back to XML file.

Change the cell value programatically by doing what, exactly?  (show some
code).

The value cannot save back to XML, how exactly?  Is an exception being
thrown?  (show some code)

-cd
Taoge - 29 Jul 2006 17:28 GMT
1.        dgTrack.Rows[Row].Cells["Picture"].Value = Picture;
               dgTrack.Rows[Row].Cells["Longitude"].Value = Longitude;
               dgTrack.Rows[Row].Cells["Latitude"].Value = Latitude;
               dgTrack.Rows[Row].Cells["Radius"].Value = Radius;
               dgTrack.Rows[Row].Cells["Audio1"].Value = objAudio.C1;
               dgTrack.Rows[Row].Cells["Audio2"].Value = objAudio.C2;

               dataSet.WriteXml("setting.xml");
No exception is thrown.

Thanks.

>> DataGridView bind to DataSet which read data from a XML file, when I
>> edit the cell value and save back, it's ok; but when change the cell
[quoted text clipped - 7 lines]
>
> -cd
Carl Daniel [VC++ MVP] - 29 Jul 2006 18:46 GMT
>     1.        dgTrack.Rows[Row].Cells["Picture"].Value = Picture;
>                dgTrack.Rows[Row].Cells["Longitude"].Value = Longitude;
[quoted text clipped - 5 lines]
>                dataSet.WriteXml("setting.xml");
> No exception is thrown.

I think you may need to call DataSet.AcceptChanges before WriteXml to make
the edited valus "stick".

-cd
Taoge - 30 Jul 2006 09:25 GMT
Hi Daniel,

I found that I can't write back XML everytime after I use OpenFileDialog to
find a file, otherwise it's OK.

Thanks!

>>     1.        dgTrack.Rows[Row].Cells["Picture"].Value = Picture;
>>                dgTrack.Rows[Row].Cells["Longitude"].Value = Longitude;
[quoted text clipped - 10 lines]
>
> -cd
Taoge - 30 Jul 2006 11:04 GMT
Hi Carl,

It's because OpenFileDialog changed the current directory.

Thanks!

>> DataGridView bind to DataSet which read data from a XML file, when I
>> edit the cell value and save back, it's ok; but when change the cell
[quoted text clipped - 7 lines]
>
> -cd

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.