470,636 Members | 1,616 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

DataGrid - sorting/paging problem

Hi.

I have created a datagrid (datagrid1) without any columns on a aspx page.
Then aspx.vb adds columns from a database.

It is somthing like this ....
==================================
Dim myBoundColumnEntryBy As New BoundColumn()
myBoundColumnEntryBy.DataField = "Entry By"
myBoundColumnEntryBy.SortExpression = "Entry By"
myBoundColumnEntryBy.HeaderText = "Entry By"
DataGrid1.Columns.Add(myBoundColumnEntryBy)

DataGrid1.DataSource = dv ' dv is a dataview.
DataGrid1.CurrentPageIndex = 0
DataGrid1.DataBind()
==================================

Everything working except Sorting/Paging features.
When I click the sorting or paging the whole datagrid disappear.

Any idea?

Thanks.
Haji
Nov 17 '05 #1
2 3054
Sorry ... I forgot to mention this ...

When I click for sorting it does not get the subroutine
"DataGrid1_SortCommand" at all.

If I create the column in design mode (not runtime) then when I click for
sorting it calls the subroutine and do sorting.

Haji

"Hajime Kusakabe" <ha*************@eimcoprocess.com> wrote in message
news:OM*************@TK2MSFTNGP11.phx.gbl...
Hi.

I have created a datagrid (datagrid1) without any columns on a aspx page.
Then aspx.vb adds columns from a database.

It is somthing like this ....
==================================
Dim myBoundColumnEntryBy As New BoundColumn()
myBoundColumnEntryBy.DataField = "Entry By"
myBoundColumnEntryBy.SortExpression = "Entry By"
myBoundColumnEntryBy.HeaderText = "Entry By"
DataGrid1.Columns.Add(myBoundColumnEntryBy)

DataGrid1.DataSource = dv ' dv is a dataview.
DataGrid1.CurrentPageIndex = 0
DataGrid1.DataBind()
==================================

Everything working except Sorting/Paging features.
When I click the sorting or paging the whole datagrid disappear.

Any idea?

Thanks.
Haji

Nov 17 '05 #2
Can you send your codebehind file code, actually where you are creating
columns for datagrid.

--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"Hajime Kusakabe" <ha*************@eimcoprocess.com> wrote in message
news:OM*************@TK2MSFTNGP11.phx.gbl...
Hi.

I have created a datagrid (datagrid1) without any columns on a aspx page.
Then aspx.vb adds columns from a database.

It is somthing like this ....
==================================
Dim myBoundColumnEntryBy As New BoundColumn()
myBoundColumnEntryBy.DataField = "Entry By"
myBoundColumnEntryBy.SortExpression = "Entry By"
myBoundColumnEntryBy.HeaderText = "Entry By"
DataGrid1.Columns.Add(myBoundColumnEntryBy)

DataGrid1.DataSource = dv ' dv is a dataview.
DataGrid1.CurrentPageIndex = 0
DataGrid1.DataBind()
==================================

Everything working except Sorting/Paging features.
When I click the sorting or paging the whole datagrid disappear.

Any idea?

Thanks.
Haji

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Stanley Cheung | last post: by
1 post views Thread by Pums | last post: by
1 post views Thread by Jeremy | last post: by
4 posts views Thread by Manny Chohan | last post: by
2 posts views Thread by Luis Esteban Valencia | last post: by
2 posts views Thread by saleek | last post: by
2 posts views Thread by Kuldeep | last post: by
3 posts views Thread by Toni | last post: by
???
reply views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.