473,385 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 1295
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
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
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
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
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
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
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
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.