473,507 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datagrid paging in codebehind vb.net

Hello,

I declared a Datagrid in my codebehind (in vb.net, the grid is named "CoreDataGrid") and now I want to manage the OnPageIndexChanged-Event in this codebehind and not in the .aspx file.
I already have the associated sub:
Sub CoreDataGrid_Paging(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs)
CoreDataGrid.CurrentPageIndex = e.NewPageIndex
CoreDataGrid_DataBind()
End Sub

I read some articles about raising events aso but I didn't understood them fully. Maybe someone could explain it to me? thanks a lot

--------------------------------
From: Alexander Herrmann

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>zZerb/52qkeQjq1oBflSqQ==</Id>
Jul 21 '05 #1
2 1301
Alexander,

Are you using Vistual.StudioNet?

Cor

I declared a Datagrid in my codebehind (in vb.net, the grid is named "CoreDataGrid") and now I want to manage the OnPageIndexChanged-Event in
this codebehind and not in the .aspx file. I already have the associated sub:
Sub CoreDataGrid_Paging(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs) CoreDataGrid.CurrentPageIndex = e.NewPageIndex
CoreDataGrid_DataBind()
End Sub

I read some articles about raising events aso but I didn't understood them fully. Maybe someone could explain it to me? thanks a lot
--------------------------------
From: Alexander Herrmann

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>zZerb/52qkeQjq1oBflSqQ==</Id>

Jul 21 '05 #2
Alexander,

In VB.Net, you need to define the method as an event handler. You can
do this by appending the "Handles" keyword at the end of your methods
signature and then type the event you want to handle.

Sub CoreDataGrid_Paging(ByVal sender As Object, ByVal e As
DataGridPageChangedEventArgs) Handles CoreDataGrid.Paging
Alexander Herrmann via .NET 247 <an*******@dotnet247.com> wrote in message news:<ek**************@TK2MSFTNGP15.phx.gbl>...
Hello,

I declared a Datagrid in my codebehind (in vb.net, the grid is named "CoreDataGrid") and now I want to manage the OnPageIndexChanged-Event in this codebehind and not in the .aspx file.
I already have the associated sub:
Sub CoreDataGrid_Paging(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs)
CoreDataGrid.CurrentPageIndex = e.NewPageIndex
CoreDataGrid_DataBind()
End Sub

I read some articles about raising events aso but I didn't understood them fully. Maybe someone could explain it to me? thanks a lot

--------------------------------
From: Alexander Herrmann

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>zZerb/52qkeQjq1oBflSqQ==</Id>

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3148
by: Hajime Kusakabe | last post by:
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...
2
2227
by: enak | last post by:
I can not get my datagrid to page. I have a datagrid that I can sort 2 of the columns. This works great. I added paging and when I display the dg it shows 5 pages. (I am showing page numbers at...
1
1251
by: mg | last post by:
I have created a databound datagrid programatically (that is, without wizards) in my C# codebehind How can I programatically add sorting and paging to this datagrid?
1
2336
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...
2
3990
by: Ben | last post by:
Hi, I'd like to have a datagrid that has a dropdownlist in the pager control for setting the page size. I can get the control into the pager inside the datagrid itemcreated event by checking for...
3
2769
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
4
2101
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...
0
237
by: I am Sam | last post by:
On my local machine the paging works just fine. On the Remote server I get the following error message: CS0117: 'ASP.EVNR_aspx' does not contain a definition for 'PageChanged_Click' Here is...
2
363
by: Alexander Herrmann via .NET 247 | last post by:
Hello, I declared a Datagrid in my codebehind (in vb.net, the grid is named "CoreDataGrid") and now I want to manage the OnPageIndexChanged-Event in this codebehind and not in the .aspx file. I...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.