Click here to Skip to main content
15,891,633 members
Home / Discussions / C#
   

C#

 
QuestionHow to change MenuStrip default icon when child is maximized Pin
bcryner17-Dec-08 11:03
bcryner17-Dec-08 11:03 
AnswerRe: How to change MenuStrip default icon when child is maximized Pin
Eddy Vluggen18-Dec-08 4:47
professionalEddy Vluggen18-Dec-08 4:47 
GeneralRe: How to change MenuStrip default icon when child is maximized Pin
bcryner18-Dec-08 5:06
bcryner18-Dec-08 5:06 
QuestionAdd Table to XML file using Dataset... Pin
Greg Cetti17-Dec-08 10:11
Greg Cetti17-Dec-08 10:11 
Questioninsert space with pattern matching. Pin
Member 232448317-Dec-08 10:02
Member 232448317-Dec-08 10:02 
AnswerRe: insert space with pattern matching. Pin
User 665817-Dec-08 10:19
User 665817-Dec-08 10:19 
GeneralRe: insert space with pattern matching. Pin
Member 232448317-Dec-08 10:36
Member 232448317-Dec-08 10:36 
QuestionWinForms - Grid View bind to xml file Pin
duk3nukem17-Dec-08 9:55
duk3nukem17-Dec-08 9:55 
Today i was attempting (for the first time) to make a simple application that will allow me to read XML file into Grid View control (via DataSet), and later on save back any changes back to xml file (Win forms application).
For time being i'm "ignoring" the "save" part, as i'm not able even to get the "view/load" part to work proerply, so i will try to get that working later on once i fix the initial problem i'm seeking help for.

I've tried something thats throwing me exception but since i've never tried binding a dataset to XML i'm probably doing something stupid or missing something...

i've made simple xml file (named it: XMLFile1.xml) with the following content:
<?xml version="1.0" encoding="utf-8" ?>
<item_list>
  <item>
    <title>item 1</title>
    <des>item 1 description</des>
  </item>
  <item>
    <title>item 2</title>
    <des>item 2 description</des>
  </item>
</item_list> 


on the form i added:
1. button with default name of button1.
2. DataGridView with default name of dataGridView1.
3. DataSet with default name of dataSet1.

inside the data grid i've created 2 columns with names "title" & "des".

finally created click event for button with the following:
private void button1_Click(object sender, EventArgs e)
{
    string xmlPath = @"..\..\XMLFile1.xml";

    dataSet1.ReadXml( xmlPath, XmlReadMode.ReadSchema );
    dataGridView1.DataMember = "item";
}


Now the problem i have is the line:
dataGridView1.DataMember = "item";
is thowing exception of "Child list for field item cannot be created".

The truth is i'm not sure if this error is result of invalid xml file i've created, or i'm not using properly the DataMember property.

I would appreciate if anyone could help me & point me in right direction of what i'm doing wrong here.

best regards,
Idan B.

"Assumptions is the mother of all f***ups"

AnswerRe: WinForms - Grid View bind to xml file Pin
bcryner17-Dec-08 11:12
bcryner17-Dec-08 11:12 
GeneralRe: WinForms - Grid View bind to xml file [modified] Pin
duk3nukem18-Dec-08 5:17
duk3nukem18-Dec-08 5:17 
AnswerRe: WinForms - Grid View bind to xml file Pin
AnthoJoh18-Dec-08 4:48
AnthoJoh18-Dec-08 4:48 
GeneralRe: WinForms - Grid View bind to xml file [modified] Pin
duk3nukem18-Dec-08 5:24
duk3nukem18-Dec-08 5:24 
QuestionC# and .ZIP files Pin
amityo17-Dec-08 9:01
amityo17-Dec-08 9:01 
AnswerRe: C# and .ZIP files Pin
Christian Graus17-Dec-08 9:14
protectorChristian Graus17-Dec-08 9:14 
GeneralRe: C# and .ZIP files Pin
led mike17-Dec-08 9:22
led mike17-Dec-08 9:22 
AnswerRe: C# and .ZIP files Pin
Lev Danielyan18-Dec-08 0:38
Lev Danielyan18-Dec-08 0:38 
Questionhow to put the annotation to the place where mouse click for chart control Pin
Seraph_summer17-Dec-08 8:35
Seraph_summer17-Dec-08 8:35 
QuestionVisual Studio Team System Novice - How to start Pin
Nadia Monalisa17-Dec-08 8:34
Nadia Monalisa17-Dec-08 8:34 
AnswerRe: Visual Studio Team System Novice - How to start Pin
Christian Graus17-Dec-08 9:03
protectorChristian Graus17-Dec-08 9:03 
GeneralRe: Visual Studio Team System Novice - How to start Pin
Nadia Monalisa17-Dec-08 9:18
Nadia Monalisa17-Dec-08 9:18 
GeneralRe: Visual Studio Team System Novice - How to start Pin
Christian Graus17-Dec-08 9:52
protectorChristian Graus17-Dec-08 9:52 
QuestionTabControl events Pin
nlowdon17-Dec-08 8:12
nlowdon17-Dec-08 8:12 
AnswerRe: TabControl events Pin
#realJSOP17-Dec-08 8:23
mve#realJSOP17-Dec-08 8:23 
GeneralRe: TabControl events Pin
Luc Pattyn17-Dec-08 8:52
sitebuilderLuc Pattyn17-Dec-08 8:52 
GeneralRe: TabControl events Pin
nlowdon17-Dec-08 10:15
nlowdon17-Dec-08 10:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.