473,513 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data not show in grid help

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
Nov 17 '05 #1
2 985
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.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"paolol" <paolol@_nospamma_salsan.net> wrote in message
news:OS**************@TK2MSFTNGP15.phx.gbl...
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

Nov 17 '05 #2
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:
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.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2006
by: kk | last post by:
Have 2 problems, any help is appreciated. Tab with Grids -------------- BL - fetching data from DB ( 5 secs - 10 rows) Grid Laod - 20 secs Grid Paint on tab change - 20 secs Problem: The...
5
2475
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to...
1
2083
by: Sunny | last post by:
Hi, I am using Databases in my applications, i have a table with an average of 3.5 million records, i am trying to show the search results in a DataGrid from that table, but the results take a very...
2
2486
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is...
6
6678
by: Tejpal Garhwal | last post by:
I have datagrid filled with some data rows. At the run time i want know how many total rows are there in the data grid ? Any idea ? Any Suggestions ? Thanks in advance Tej
4
2463
by: JIM.H. | last post by:
Hello, I am trying to write the data I got from a web service to my table in SQL Server I need to append the dataset wsDS to the dataset ds and do update. PVS.myWS.Loader load = new...
9
3993
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
9
2671
by: trint | last post by:
How can I retrieve all of the data from a datagridview? Any help is appreciated. Thanks, Trint
6
2930
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
0
1273
by: pragadheesh | last post by:
I have a TAB where a data grid gets displayed. I want to access the elements of the datagrid. but i'm getting the following error. "Data cannot be read from a DataGrid which is not bound to a...
0
7267
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7391
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7120
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.