Solved

XML INTO DATAGRIDVIEW IN VB.NET

Posted on 2013-01-05
2
1,728 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
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.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now