Saturday, March 31, 2012

Table to Grid

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,
XDi 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

"SK" wrote:

Quote:

Originally Posted by

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
>
>
>


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

- Thanks

"Murtaza" <Murtaza@.discussions.microsoft.comwrote in message
news:9C7365A4-7AC3-497D-B383-02D9F700F1C9@.microsoft.com...

Quote:

Originally Posted by

>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
>
"SK" wrote:
>

Quote:

Originally Posted by

>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
>>
>>
>>


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...

"XD" wrote:

Quote:

Originally Posted by

No it is not datatable. It is normal web.UI.webcontrols.Table
I want to view the data in gridview1 than a table.
>
- Thanks
>
"Murtaza" <Murtaza@.discussions.microsoft.comwrote in message
news:9C7365A4-7AC3-497D-B383-02D9F700F1C9@.microsoft.com...

Quote:

Originally Posted by

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

"SK" wrote:

Quote:

Originally Posted by

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
>
>
>


>
>
>

0 comments:

Post a Comment