DataGrid - sorting/paging problem

  • Thread starter Thread starter Hajime Kusakabe
  • Start date Start date
H

Hajime Kusakabe

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
 
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
 
Can you send your codebehind file code, actually where you are creating
columns for datagrid.
 
Back
Top