Data not show in grid help

  • Thread starter Thread starter paolol
  • Start date Start date
P

paolol

Hi,
I try to load an XML file on a Grid but I don't see the data, only the
fields.
Any suggestion ??? code is :
DialogResult res=openFileDialog1.ShowDialog(this);
if (res==DialogResult.OK)
{
string fn=openFileDialog1.FileName;
dataset11.ReadXml(fn);
textBox1.Text=fn;
dataGrid1.DataSource=dataset11;
dataGrid1.DataMember="product";
dataGrid1.Enabled.Equals(true);
}

thanks,
paolol
 
Paolol,

First off, you will want to change the call to the Enabled property to
be:

dataGrid1.Enabled = true;

Calling Equals does not set the value, rather, it performs a comparison.

Also, when you are setting the data source, I don't know if the columns
are autoconfigured. You might want to check the TableStyles property on the
grid to see if there are any column mappings (after you bind to the data).
If not, you will have to create the columns yourself.

Hope this helps.
 
Hi Nicholas,
I did the change, all the column show the correct label but still no
data are still visible on the grid :(

Thanks for the help.
Paolol


Nicholas Paldino [.NET/C# MVP] ha scritto:
 
Back
Top