C# Convert DataTable to List and Add to GridView

I'm following code in this example -> http://dotnetawesome.blogspot.com/2014/01/how-to-group-columns-in-gridview-header-row-aspnet-programmer-friendly-way.html

On the website they have the below piece of code.
private void PopulateData()
2.            {
3.                using (MyDatabaseEntities dc = new MyDatabaseEntities())
4.                {
5.                    GridView1.DataSource = dc.SampleDatas.ToList();
6.                    GridView1.DataBind();
7.                }
8.                // Add Group Header
9.                SetGroupHeader();
10.            }

Open in new window

I am getting my data from a stored procedure and it is in a dataset.  How do I convert it to a List?  Do I have to convert it to a list to get the same result?

This is the video https://www.youtube.com/watch?v=LkFssh96VCE

Thank You
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Try something like this, where DataSet_Instance_Name is your DataSet object and XXX is the table name as a string or the index in the collection of Tables.
GridView1.DataSource = DataSet_Instance_Name.Table[XXX]; 

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Lokesh B RDeveloperCommented:

You can bind the DataTable as follows.

GridView1.DataSource = ds.Tables[0];

Imagine that your DataSet name is ds.
CipherISAuthor Commented:
Gridview.DataSource = dt;

I usually set it like that.  Thought I needed to convert it to a list for the other code.
Lokesh B RDeveloperCommented:

There is no property called Table on DataSet.

It is DataSet.Tables

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.