DataGrid - sorting/paging problem

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
 
H

Hajime Kusakabe

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
 
S

Saravana

Can you send your codebehind file code, actually where you are creating
columns for datagrid.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top