Re: DataGrid and XML document

From: Thejus (thejus_raghavan_at_hotmail.com)
Date: 06/28/04


Date: Mon, 28 Jun 2004 07:13:19 -0500

Hi,

When I read from a XML Document and assign -

DataSet.ReadXml(@"C:\Abc.Xml",XmlReadMode.Auto);
DataGrid.DataSource = DataSet;

I get the DataGrid filled, but the data is not filled in the datagrid. It
shows Table Name as a link, on clicking of which the grid is filled. Even
the DataGrid.Expand(-1) do not expand the rows.

Is there any way for this?

Thanks

Thejus

"Jussi" <a.a@a.com> wrote in message news:eeY$LjhSEHA.2692@TK2MSFTNGP09.phx.gbl...
> I load a XML document in the DataGrid:
>
> private System.Windows.Forms.DataGrid myDataGrid = new DataGrid();
> private DataSet m_myDataSet = new DataSet();
>
> m_myDataSet.ReadXml(@"C:\...\MyDocument.xml");
> myDataGrid.DataSource = m_myDataSet;
>
> This works fine and user can edit the loaded document. The problem is that I
> don't want to give possibility to change the structure of the
> MyDocument.xml. User should only change data in the already existing fields.
> In the DataGrid user can create for example new rows and these are saved to
> the MyDocument.xml when
>
> m_myDataSet.WriteXml(@"C:\...\MyDocument.xml");
>
> is done and MyDocument.xml is corrupted. Is there a way to avoid this?
>
> -JK
>
>



Relevant Pages

  • Re: DataGrid and XML document
    ... > I load a XML document in the DataGrid: ... > This works fine and user can edit the loaded document. ... User should only change data in the already existing fields. ...
    (microsoft.public.dotnet.languages.csharp)
  • DataGrid and XML document
    ... I load a XML document in the DataGrid: ... private DataSet m_myDataSet = new DataSet; ... User should only change data in the already existing fields. ...
    (microsoft.public.dotnet.languages.csharp)
  • DataGrid parent relationships for nested elements, or any kind of formatting!
    ... I'm making a very simple app for editing an XML document using a ... Since datagrid doesn't seem to support ANY formatting ... upper most parent table from an element, or even better: ... sample code and/or specifics. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: DataGrid and XML document
    ... use following statement after populating the datagrid with the dataset. ... When I read from a XML Document and assign - ... I get the DataGrid filled, but the data is not filled in the datagrid. ... > In the DataGrid user can create for example new rows and these are saved to ...
    (microsoft.public.dotnet.languages.csharp)
  • How does InnerText appear in a Dataset loaded by .ReadXml/.ReadXmlSchema
    ... I've got an XML document I am loading into a dataset using ..ReadXml/.ReadXmlSchema. ... The dataset looks perfect and I can bind it to a datagrid and elements appear as tables and attributes appear as ...
    (microsoft.public.dotnet.xml)