Solved

XML INTO DATAGRIDVIEW IN VB.NET

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
forward schedule of change 1 50
Reseller Hosting 2 88
Problem to picture file 20 49
Internet Service Provider 3 49
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

786 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