DataGridView

DataGridView

Post by Vladisla » Thu, 11 Nov 2004 21:19:32


I have schema file (xsd). And with rules from that file I must filling my
dataGridView cells. I wrote that code but it don't work, the text values in
the dataGridView are erased and when ichange value in current cell the value
not saved to dataSet.

private void newToolStripMenuItem_Click(object sender, EventArgs e)

{

this.ethmoduleDS = new DataSet();

this.ethmoduleDS.ReadXmlSchema(this.schemaFileName);

this.ethmoduleDS.Locale = System.Globalization.CultureInfo.CurrentUICulture;

this.dataGridViewControllers.AutoGenerateColumns = false;

this.dataGridViewControllers.DataSource = this.ethmoduleDS;

this.dataGridViewControllers.DataMember = "controller";

this.dataGridViewControllers.Visible = true;

this.dataGridViewControllers.DataBindings.Add("Text", this.ethmoduleDS,
"controller", true);

this.UpdateMenus(true);

}

private void dataGridViewControllers_CellValueChanged(object sender,
DataGridViewCellEventArgs e)

{

if (null != this.ethmoduleDS)

ethmoduleDS.AcceptChanges();

}
 
 
 

DataGridView

Post by Vladisla » Thu, 11 Nov 2004 21:56:20

I'm working in C# 2005 Express Edition Beta
I have schema file (xsd). And with rules from that file I must filling my
dataGridView cells. I wrote that code but it don't work, the text values in
the dataGridView are erased and when ichange value in current cell the value
not saved to dataSet.

private void newToolStripMenuItem_Click(object sender, EventArgs e)

{

this.ethmoduleDS = new DataSet();

this.ethmoduleDS.ReadXmlSchema(this.schemaFileName);

this.ethmoduleDS.Locale = System.Globalization.CultureInfo.CurrentUICulture;

this.dataGridViewControllers.AutoGenerateColumns = false;

this.dataGridViewControllers.DataSource = this.ethmoduleDS;

this.dataGridViewControllers.DataMember = "controller";

this.dataGridViewControllers.Visible = true;

this.dataGridViewControllers.DataBindings.Add("Text", this.ethmoduleDS,
"controller", true);

this.UpdateMenus(true);

}

private void dataGridViewControllers_CellValueChanged(object sender,
DataGridViewCellEventArgs e)

{

if (null != this.ethmoduleDS)

ethmoduleDS.AcceptChanges();

}