Step 1:
DataSet dsMain = new DataSet();
dsMain.ReadXml(my xml path);
Results I got 36 datatable in that dsMain dstaset.
Step 2:
Dynamically created 36 DataGridView to display all datatable.
It results some DataGridView has table but no data. And some columns were missing.
Reason those columns are auto generated Mapping column. And it column name like TabelName_Id.
Step 3:
for (int index = 0; index < ds1.Tables.Count; index++)
{
DataTable dtnew = ds1.Tables[index].Copy();
for (int ColCount = 0; ColCount < dtnew.Columns.Count; ColCount++)
{
if (dtnew.Columns[0].ColumnMapping == MappingType.Hidden)
{
dtnew.Columns[0].ColumnMapping = MappingType.Element;
}
}
}
Now that column is get visible. But my problem is I could not get parent auto generated column.
Example:
Tabel 1: Parent-> Columns(Parent_Id,Col1,Col2,Col3)
Tabel 2: Child -> Columns(Child_Id,Col1,Col2,Col3,Parent_Id)
after following step 3 I able to see Child_Id in Child table but I couldn't able to see Parent_Id in Child table.
Please help me get out of this.
My sample xml
<Parent value="25">
<Child>
<Inner></Inner>
</Child>
</Parent>