datagrid paging in codebehind vb.net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexander Herrmann via .NET 247

    #1

    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>
  • Cor Ligthert

    #2
    Re: datagrid paging in codebehind vb.net

    Alexander,

    Are you using Vistual.StudioN et?

    Cor
    [color=blue]
    >
    > I declared a Datagrid in my codebehind (in vb.net, the grid is named[/color]
    "CoreDataGr id") and now I want to manage the OnPageIndexChan ged-Event in
    this codebehind and not in the .aspx file.[color=blue]
    > I already have the associated sub:
    > Sub CoreDataGrid_Pa ging(ByVal sender As Object, ByVal e As[/color]
    DataGridPageCha ngedEventArgs)[color=blue]
    > CoreDataGrid.Cu rrentPageIndex = e.NewPageIndex
    > CoreDataGrid_Da taBind()
    > End Sub
    >
    > I read some articles about raising events aso but I didn't understood them[/color]
    fully. Maybe someone could explain it to me? thanks a lot[color=blue]
    >
    >
    >
    > --------------------------------
    > From: Alexander Herrmann
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>zZerb/52qkeQjq1oBflSq Q==</Id>[/color]


    Comment

    • Lewis Moten

      #3
      Re: datagrid paging in codebehind vb.net

      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 <anonymous@dotn et247.com> wrote in message news:<ek#kv1YkE HA.1348@TK2MSFT NGP15.phx.gbl>. ..[color=blue]
      > 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>[/color]

      Comment

      Working...