473,666 Members | 2,060 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 "CoreDataGr id") and now I want to manage the OnPageIndexChan ged-Event in this codebehind and not in the .aspx file.
I already have the associated sub:
Sub CoreDataGrid_Pa ging(ByVal sender As Object, ByVal e As DataGridPageCha ngedEventArgs)
CoreDataGrid.Cu rrentPageIndex = e.NewPageIndex
CoreDataGrid_Da taBind()
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/52qkeQjq1oBflSq Q==</Id>
Jul 21 '05 #1
2 1310
Alexander,

Are you using Vistual.StudioN et?

Cor

I declared a Datagrid in my codebehind (in vb.net, the grid is named "CoreDataGr id") and now I want to manage the OnPageIndexChan ged-Event in
this codebehind and not in the .aspx file. I already have the associated sub:
Sub CoreDataGrid_Pa ging(ByVal sender As Object, ByVal e As DataGridPageCha ngedEventArgs) CoreDataGrid.Cu rrentPageIndex = e.NewPageIndex
CoreDataGrid_Da taBind()
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/52qkeQjq1oBflSq Q==</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_Pa ging(ByVal sender As Object, ByVal e As
DataGridPageCha ngedEventArgs) Handles CoreDataGrid.Pa ging
Alexander Herrmann via .NET 247 <an*******@dotn et247.com> wrote in message news:<ek******* *******@TK2MSFT NGP15.phx.gbl>. ..
Hello,

I declared a Datagrid in my codebehind (in vb.net, the grid is named "CoreDataGr id") and now I want to manage the OnPageIndexChan ged-Event in this codebehind and not in the .aspx file.
I already have the associated sub:
Sub CoreDataGrid_Pa ging(ByVal sender As Object, ByVal e As DataGridPageCha ngedEventArgs)
CoreDataGrid.Cu rrentPageIndex = e.NewPageIndex
CoreDataGrid_Da taBind()
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/52qkeQjq1oBflSq Q==</Id>

Jul 21 '05 #3

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

Similar topics

2
3151
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 myBoundColumnEntryBy As New BoundColumn() myBoundColumnEntryBy.DataField = "Entry By" myBoundColumnEntryBy.SortExpression = "Entry By"
2
2244
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 the bottom of the dg.) When I click on the pages nothing happens until I get to the last page. Then and only then is the last page displayed. If I go back through the pages the second to last page displayes the first page again.
1
1256
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
2348
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 page. i.e. If I have: IntegerValue StringValue CurrencyValue 0 Item 0 0 1 Item 1 1.23
2
3995
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 ListItemType.Pager. The problem I'm having is subscribing to the selectedindex changed event. The datagrid doesn't even seem fire an itemcommand, but that's ok, just the selectedindex changed event would do... Any advice is greatly appreciated!
3
2777
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 System.Collections; using System.ComponentModel; using System.Data;
4
2107
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 codebehind file. I am using c#. Thanks Manny
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 the Interface Markup: <asp:datagrid id="clubdg1" runat="server" CssClass="txt" ShowFooter="True" GridLines="Horizontal" BorderWidth="1px" BorderColor="White" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4"
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 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...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8783
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8552
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2773
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.