Ask a Question related to ASP.NET General, Design and Development.
-
Nimbus Dorkus #1
Re: datagrid paging - codebehind
are you setting the button column to CommandName=Select in the ASP page?
"Bent Kjeldsen" <news@nospam.dithjem.dk> wrote in message
news:eYgAfqrRDHA.2148@TK2MSFTNGP11.phx.gbl...> Hi.
> (Framework 1.1)
> I'm trying to make paging on a datagrid, but my eventhandler for
> PageIndexChanged is never called when I'm pressing Next, and an empty page
> is shown. Below is a small CodeBehind example. I've also tried to put the
> grid in the aspx page, but same result. Anyone?
>
> Thanks
> Bent
> Denmark
>
> Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Init
>
> InitializeComponent()
>
> Grid = New System.Web.UI.WebControls.DataGrid
>
> oForm.Controls.Add(Grid)
>
> Grid.AllowPaging = True
>
> Grid.PagerStyle.Mode = PagerMode.NextPrev
>
> Grid.PageSize = 2
>
> End Sub
>
>
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> If Not Page.IsPostBack Then
>
> BindGrid()
>
> Else
>
> AddHandler Grid.PageIndexChanged, AddressOf Me.Page_Change
>
> End If
>
> End Sub
>
>
>
> Public Sub Page_Change(ByVal sender As System.Object, ByVal e As
> System.Web.UI.WebControls.DataGridPageChangedEvent Args)
>
> Response.Write("Page_Change never called")
>
> Grid.CurrentPageIndex = e.NewPageIndex
>
> BindGrid()
>
> End Sub
>
>
>
>
>
>
>
>
>
>
Nimbus Dorkus Guest
-
DataGrid and Paging
Hello Masters! Anyone can help me with the datagrid, well, the app load a lot of data from DB and it show on the datagrid, and well, I need to... -
datagrid codebehind formatting
What if columns are not boundColumns? "Teemu Keiski" <joteke@aspalliance.com> escribió en el mensaje news:eQZRrOYDEHA.1604@TK2MSFTNGP11.phx.gbl... -
Datagrid SelectedIndexChanged Problem in CodeBehind
I am attempting to use the SelectedIndexChanged to detect when a row has been selected. I have seen many examples where they are writing all the... -
First Datagrid row with paging
Hi, My Datagrid header is a shoe size range and depends on the first datagrid row - first article size range. So, i need to get the first row... -
using Paging in Datagrid
Hi, I am adding a paging function to a datagrid control, the datasource is a DataSet Object. Based on some articles, I just add some attributes to... -
Bent Kjeldsen #2
Re: datagrid paging - codebehind
I'm not quite sure what you mean ? :-)
Is it mandatory? Can it be set codebehind?
Thanks.
Bent
"Nimbus Dorkus" <spanz_za@hotmail.com> wrote in message
news:eeRgYSsRDHA.1896@TK2MSFTNGP12.phx.gbl...page> are you setting the button column to CommandName=Select in the ASP page?
>
>
> "Bent Kjeldsen" <news@nospam.dithjem.dk> wrote in message
> news:eYgAfqrRDHA.2148@TK2MSFTNGP11.phx.gbl...> > Hi.
> > (Framework 1.1)
> > I'm trying to make paging on a datagrid, but my eventhandler for
> > PageIndexChanged is never called when I'm pressing Next, and an emptythe> > is shown. Below is a small CodeBehind example. I've also tried to put>> > grid in the aspx page, but same result. Anyone?
> >
> > Thanks
> > Bent
> > Denmark
> >
> > Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Init
> >
> > InitializeComponent()
> >
> > Grid = New System.Web.UI.WebControls.DataGrid
> >
> > oForm.Controls.Add(Grid)
> >
> > Grid.AllowPaging = True
> >
> > Grid.PagerStyle.Mode = PagerMode.NextPrev
> >
> > Grid.PageSize = 2
> >
> > End Sub
> >
> >
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> >
> > If Not Page.IsPostBack Then
> >
> > BindGrid()
> >
> > Else
> >
> > AddHandler Grid.PageIndexChanged, AddressOf Me.Page_Change
> >
> > End If
> >
> > End Sub
> >
> >
> >
> > Public Sub Page_Change(ByVal sender As System.Object, ByVal e As
> > System.Web.UI.WebControls.DataGridPageChangedEvent Args)
> >
> > Response.Write("Page_Change never called")
> >
> > Grid.CurrentPageIndex = e.NewPageIndex
> >
> > BindGrid()
> >
> > End Sub
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
Bent Kjeldsen Guest
-
Bent Kjeldsen #3
Re: datagrid paging - codebehind
Found the problem,
Page.EnableViewState = True
must be in Page_Init when disabled in Web.Config
Thanks
Bent
"Nimbus Dorkus" <spanz_za@hotmail.com> wrote in message
news:eeRgYSsRDHA.1896@TK2MSFTNGP12.phx.gbl...page> are you setting the button column to CommandName=Select in the ASP page?
>
>
> "Bent Kjeldsen" <news@nospam.dithjem.dk> wrote in message
> news:eYgAfqrRDHA.2148@TK2MSFTNGP11.phx.gbl...> > Hi.
> > (Framework 1.1)
> > I'm trying to make paging on a datagrid, but my eventhandler for
> > PageIndexChanged is never called when I'm pressing Next, and an emptythe> > is shown. Below is a small CodeBehind example. I've also tried to put>> > grid in the aspx page, but same result. Anyone?
> >
> > Thanks
> > Bent
> > Denmark
> >
> > Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Init
> >
> > InitializeComponent()
> >
> > Grid = New System.Web.UI.WebControls.DataGrid
> >
> > oForm.Controls.Add(Grid)
> >
> > Grid.AllowPaging = True
> >
> > Grid.PagerStyle.Mode = PagerMode.NextPrev
> >
> > Grid.PageSize = 2
> >
> > End Sub
> >
> >
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> >
> > If Not Page.IsPostBack Then
> >
> > BindGrid()
> >
> > Else
> >
> > AddHandler Grid.PageIndexChanged, AddressOf Me.Page_Change
> >
> > End If
> >
> > End Sub
> >
> >
> >
> > Public Sub Page_Change(ByVal sender As System.Object, ByVal e As
> > System.Web.UI.WebControls.DataGridPageChangedEvent Args)
> >
> > Response.Write("Page_Change never called")
> >
> > Grid.CurrentPageIndex = e.NewPageIndex
> >
> > BindGrid()
> >
> > End Sub
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
Bent Kjeldsen Guest



Reply With Quote

