Click here to Skip to main content
15,914,447 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: WinForms - Grid View bind to xml file Pin
bcryner17-Dec-08 11:12
bcryner17-Dec-08 11:12 
I just quickly browsed your post, so I may be way off on the answer, but it looks like you are on the right track.

DataSet dsXml = new DataSet();
dsXml.ReadXml(fileName);


Within a DataSet you can have multiple DataTable objects depending on the format of the XML. What I've done in the past is to create a dynamic combo box that gets the name of every single table in the DataSet.

You would want to set the DataSource of you DataGridView to the DataSet object we read (dsXml). Then when your combo box changes you can set the data member to the name of the selected item.

private void LoadComboBox()
{
   foreach (DataTable tbl in dsXml.Tables)
   {
       ComboBox1.Items.Add(tbl.TableName);
   }
}
private void SetSource()
{
   DataGridView1.DataSource = dsXml;
}

private void OnComboChanged()
{
   DataGridView1.DataMember = ComboBox1.Text;
}



You could also set the source to a specific table in the DataSet.

DataGridView1.DataSource = dsXml.Tables[0];

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
professional#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 
GeneralRe: TabControl events Pin
Luc Pattyn17-Dec-08 10:22
sitebuilderLuc Pattyn17-Dec-08 10:22 

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.