472,951 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,951 software developers and data experts.

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 3117
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stanley Cheung | last post by:
Hi all, How can I import a csv file and display as a datagrid directly. Now, I am using datatable to bind to datagrid, but I got the problem for sorting and paging, i don't know how to make a...
1
by: Pums | last post by:
Hi All For one page I want to implement sortng as well as paging. Curretly that page is using datagrid for data binding and sorting. Datagrid supports attributes like sortexpression and sort order...
1
by: Jeremy | last post by:
I want my gird to sort only the items on the current page when I click on a column header. I wrote a little test app, but when I sort it pulls in items from other pages and places them on the current...
4
by: Manny Chohan | last post by:
hi guys, my code is returning an array and i need to create datagrid so that i can have sorting and implement prev....next function on it to navigate. is there any way this can be done in...
2
by: Luis Esteban Valencia | last post by:
I have a data grid control with a templated checkbox column residing in a asp.net user control. The checkbox boolean state determines if the item is later added or removed from another database...
1
by: GP | last post by:
I have created a datagrid that is creating columns dynamically at runtime using the template columns.Edit ,add & delete works fine. The only problem I face is with sorting,I am setting the sorting...
2
by: saleek | last post by:
Hi, I am trying to figure out why my datagrid has stopped firing the page and sort commands. Scenario: I originally had template columns in my datagrid and had set up custom bi-directional...
2
by: Kuldeep | last post by:
Hi All, I have been trying to find some algorithms for datagrid sorting and paging. Please help Regards Kuldeep
3
by: Toni | last post by:
In DataGrid and GridView I can't use paging and sorting. I am connected to database with code, not visual. Can I use paging and sorting if I populate data to grid with code, or I need to drag and...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.