473,662 Members | 2,595 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 1309
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
8432
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8764
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
8546
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
8633
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...
0
7367
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5654
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1752
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.