Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

XML INTO DATAGRIDVIEW IN VB.NET

Posted on 2013-01-05
2
Medium Priority
?
2,023 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 1500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

610 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