Click here to Skip to main content
15,925,505 members
Home / Discussions / C#
   

C#

 
AnswerRe: Cobol to .NET URGENT Pin
Colin Angus Mackay17-Feb-07 5:07
Colin Angus Mackay17-Feb-07 5:07 
GeneralRe: Cobol to .NET URGENT Pin
Niiiissssshhhhhuuuuu18-Feb-07 17:12
Niiiissssshhhhhuuuuu18-Feb-07 17:12 
QuestionTextBox, automatic scroll to bottom when appending text Pin
zark9216-Feb-07 23:14
zark9216-Feb-07 23:14 
AnswerRe: TextBox, automatic scroll to bottom when appending text Pin
Stefan Troschuetz16-Feb-07 23:19
Stefan Troschuetz16-Feb-07 23:19 
GeneralRe: TextBox, automatic scroll to bottom when appending text Pin
zark9217-Feb-07 9:09
zark9217-Feb-07 9:09 
AnswerRe: TextBox, automatic scroll to bottom when appending text Pin
Luc Pattyn17-Feb-07 1:37
sitebuilderLuc Pattyn17-Feb-07 1:37 
QuestionCC the message in email client Pin
EEmaan16-Feb-07 22:49
EEmaan16-Feb-07 22:49 
AnswerRe: CC the message in email client Pin
Michael Sync17-Feb-07 1:38
Michael Sync17-Feb-07 1:38 
AnswerRe: CC the message in email client Pin
Luc Pattyn17-Feb-07 1:40
sitebuilderLuc Pattyn17-Feb-07 1:40 
QuestionView state Pin
kalyan_241616-Feb-07 21:46
kalyan_241616-Feb-07 21:46 
AnswerRe: View state Pin
Michael Sync16-Feb-07 23:03
Michael Sync16-Feb-07 23:03 
QuestionRequest Pin
md_refay16-Feb-07 20:51
md_refay16-Feb-07 20:51 
Questionconfused phrases Pin
md_refay16-Feb-07 20:44
md_refay16-Feb-07 20:44 
AnswerRe: confused phrases Pin
Stefan Troschuetz16-Feb-07 20:58
Stefan Troschuetz16-Feb-07 20:58 
Questionconfused phrases Pin
md_refay16-Feb-07 20:42
md_refay16-Feb-07 20:42 
QuestionValidating Data in a datagridView Pin
Rocky#16-Feb-07 20:11
Rocky#16-Feb-07 20:11 
AnswerRe: Validating Data in a datagridView Pin
iylbq24716-Feb-07 22:11
iylbq24716-Feb-07 22:11 
GeneralRe: Validating Data in a datagridView Pin
Rocky#17-Feb-07 23:28
Rocky#17-Feb-07 23:28 
Questionwriting to a text file that may not exsist Pin
alostdruid16-Feb-07 18:47
alostdruid16-Feb-07 18:47 
AnswerRe: writing to a text file that may not exsist Pin
Stefan Troschuetz16-Feb-07 20:51
Stefan Troschuetz16-Feb-07 20:51 
AnswerRe: writing to a text file that may not exsist Pin
Wayne Phipps17-Feb-07 3:34
Wayne Phipps17-Feb-07 3:34 
QuestionCube and Data mining on Forms, how? Pin
TrooperIronMan16-Feb-07 14:49
TrooperIronMan16-Feb-07 14:49 
QuestionDataGridView - Bound to XMLDataDoc [modified] Pin
CopperMedal16-Feb-07 14:20
CopperMedal16-Feb-07 14:20 
I'm new to C#, so please bear with me on terminology(and spelling). I have a small example application with a form that tries to bind XMLDataDoc instances to a DataGridView. I swap in and out the instances of XMLDataDocs to my DataGridView, depending on which data I’m working with at the time.

My problem is that I can’t seem to control when to actually commit the data to my XMLDataDoc instances. At first when I was learning about binding between DataGridView and XmlDataDoc objects, I thought there was an intrinsic instant updating of the data to the XMLDataDoc when one changes data in the DataGridView, but I’m not able to understand when or where exactly this happens. The commit success is not consistent, in fact I can only get it to happen when add new data to the target row, then click into a new row, and then save.

I’m binding to my DataGridView:
newDataClass1.XmlDataDoc.Load(some_XMLFile_on_a_drive);

BindingSourceVaultItem.DataSource = newDataClass1.XmlDataDoc.DataSet.Tables["ItemColumn"];

DataGridView.DataSource = BindingSourceVaultItem;

If I then create a another XMLDataDoc instance and bind it to the DataGridView:

BindingSourceVaultItem.DataSource = newDataClass2.XmlDataDoc.DataSet.Tables["ItemColumn"];


The DefaultValuesNeeded event populates all the key data, except the itemColumn, which has its column value AutoIncrement set to true. Together, they satisfy my schema rules.

My issue is that after trying to change data within a new row of the DataGridView, and then trying to save data off to an XML file, I receive a “root element” error. I put in a DataGridView.CommitEdit() in the CurrentCellDirtyStateChanged event, in hopes to push the data at the cell level.

Am I using BindSource incorrectly for multiple XMLDataDoc instances? Any help is greatly appreciated and thanks in advance.



AnswerRe: DataGridView - Bound to XMLDataDoc Pin
CopperMedal17-Feb-07 8:07
CopperMedal17-Feb-07 8:07 
Questionfile transfer Pin
giltendezm16-Feb-07 14:16
giltendezm16-Feb-07 14:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.