Table to Grid

S

SK

How to bind a grid using table?
I've a table and I want to see that data in a grid for sorting and
pagination. Please provide an example.

Thanks,
XD
 
G

Guest

i think you are talking about the datatable,

you must fill a dataset first, then call this,

Datagrid1.Datasource = ds.Tables(0)
Datagrid1.Databind();

This will show the data in your datagrid, also make sure that you turn on
the check in autogenerate columns in Datagrid Property Builder
 
X

XD

No it is not datatable. It is normal web.UI.webcontrols.Table
I want to view the data in gridview1 than a table.

- Thanks
 
G

Guest

Then again you have to follow same approach, construct a datatable, Iterate
through every row of ur HTML table n fill that Datatable then bind that
Datatable to ur gridview....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top