DataGrid Fully Expanded

  • Thread starter Thread starter andrewcw
  • Start date Start date
A

andrewcw

I am considering using the DataGrid to show my data. I
will take the class data and serialize it / xml transform
it or simply load it into a new XML document. The new XML
document is essentially a recordset - simple rows.

I'd like the content to be fully expanded - whereas now I
get the 'recordset like' node name and have to click on it:

[-]-|
| disksetitem ( and this is hyperlinked ).

Once that is clicked, it the dataset displays. Is it
possible to automatially drive it down so that the data is
displayed ? Thanks
[ my snippet ]
System.Data.DataSet ds = new DataSet();
ds.ReadXml(fiPath,System.Data.XmlReadMode.Auto);
dataGrid1.DataSource = ds ;
dataGrid1.Expand(-1);

with XML
<?xml version="1.0" encoding="utf-8"?>
<qcrecord xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<disksetitem drive="E" customer_code="ggg" model ="xyz" ...

Thanks....
 
Andrew,
After you set the DataSource to your DataSet, set the DataMember to
'disksetitem', which is the table in your DataSet that you want displayed. A
DataSet can have multiple tables that can be displayed.
System.Data.DataSet ds = new DataSet();
ds.ReadXml(fiPath,System.Data.XmlReadMode.Auto);
dataGrid1.DataSource = ds ;
dataGrid1.DataMember = "disksetitem";
dataGrid1.Expand(-1);

Hope this helps
Jay

andrewcw said:
I am considering using the DataGrid to show my data. I
will take the class data and serialize it / xml transform
it or simply load it into a new XML document. The new XML
document is essentially a recordset - simple rows.

I'd like the content to be fully expanded - whereas now I
get the 'recordset like' node name and have to click on it:

[-]-|
| disksetitem ( and this is hyperlinked ).

Once that is clicked, it the dataset displays. Is it
possible to automatially drive it down so that the data is
displayed ? Thanks
[ my snippet ]
System.Data.DataSet ds = new DataSet();
ds.ReadXml(fiPath,System.Data.XmlReadMode.Auto);
dataGrid1.DataSource = ds ;
dataGrid1.Expand(-1);

with XML
<?xml version="1.0" encoding="utf-8"?>
<qcrecord xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<disksetitem drive="E" customer_code="ggg" model ="xyz" ...

Thanks....
 
Thanks - it worked perfectly
dataGrid1.Expand(-1);
dataGrid1.DataMember="disksetitem";
 
Back
Top