Solved

XML INTO DATAGRIDVIEW IN VB.NET

Posted on 2013-01-05
2
1,856 Views
Last Modified: 2013-12-24
I have a Datagridview which I would like to load from XML into the DATAGRIDVIEW AND I want to freeze the name Column. I can load a xml file no problem using basic datagrid. But I donot think Datagid can freeze a column if it can please show me
here is datagrid
 Public Sub xmldatagrid()
        Try

            Dim ds As New DataSet


            ds.ReadXml("http://199.233.14.22/NBA/2013/stats/ACX-FOULS-LEADERS.xml", XmlReadMode.InferSchema)
            DataGrid1.SetDataBinding(ds, "Listing")


        Catch ex As SqlException
            MessageBox.Show(ex.Message)
        End Try
    End Sub

I can not use this with Datagridview. I need xml file to be read Starting at Listing Tag.
Here is the file
http://199.233.14.22/NBA/2013/stats/ACX-FOULS-LEADERS.xml
When I create the DataSet I get one column of tags leading up to Listing Tag. Please Help
0
Comment
Question by:powerztom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
sognoct earned 500 total points
ID: 38748292
You can't freeze column in basic datagrid

Why can't you use datagridview ? Here is code for binding data to Listing tag

    Dim ds As New DataSet
    ds.ReadXml("http://199.233.14.22/NBA/2013/stats/ACX-FOULS-LEADERS.xml", XmlReadMode.InferSchema)
    With DataGridView1  ' the datagridview
      .DataSource = ds
      .DataMember = "Listing"
      .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
    End With

Then you can freeze the column that you want with no problem
0
 

Author Closing Comment

by:powerztom
ID: 38806736
Thanks
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question