DataGrid - sorting/paging problem

Discussion in 'ASP .Net' started by Hajime Kusakabe, Jul 30, 2003.

  1. 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"
    myBoundColumnEntryBy.HeaderText = "Entry By"
    DataGrid1.Columns.Add(myBoundColumnEntryBy)

    DataGrid1.DataSource = dv ' dv is a dataview.
    DataGrid1.CurrentPageIndex = 0
    DataGrid1.DataBind()
    ==================================

    Everything working except Sorting/Paging features.
    When I click the sorting or paging the whole datagrid disappear.

    Any idea?

    Thanks.
    Haji
    Hajime Kusakabe, Jul 30, 2003
    #1
    1. Advertising

  2. Sorry ... I forgot to mention this ...

    When I click for sorting it does not get the subroutine
    "DataGrid1_SortCommand" at all.

    If I create the column in design mode (not runtime) then when I click for
    sorting it calls the subroutine and do sorting.

    Haji

    "Hajime Kusakabe" <> wrote in message
    news:...
    > 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"
    > myBoundColumnEntryBy.HeaderText = "Entry By"
    > DataGrid1.Columns.Add(myBoundColumnEntryBy)
    >
    > DataGrid1.DataSource = dv ' dv is a dataview.
    > DataGrid1.CurrentPageIndex = 0
    > DataGrid1.DataBind()
    > ==================================
    >
    > Everything working except Sorting/Paging features.
    > When I click the sorting or paging the whole datagrid disappear.
    >
    > Any idea?
    >
    > Thanks.
    > Haji
    >
    >
    Hajime Kusakabe, Jul 30, 2003
    #2
    1. Advertising

  3. Hajime Kusakabe

    Saravana Guest

    Can you send your codebehind file code, actually where you are creating
    columns for datagrid.

    --
    Saravana
    Microsoft India Community Star,
    MCAD,SE,SD,DBA.


    "Hajime Kusakabe" <> wrote in message
    news:...
    > 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"
    > myBoundColumnEntryBy.HeaderText = "Entry By"
    > DataGrid1.Columns.Add(myBoundColumnEntryBy)
    >
    > DataGrid1.DataSource = dv ' dv is a dataview.
    > DataGrid1.CurrentPageIndex = 0
    > DataGrid1.DataBind()
    > ==================================
    >
    > Everything working except Sorting/Paging features.
    > When I click the sorting or paging the whole datagrid disappear.
    >
    > Any idea?
    >
    > Thanks.
    > Haji
    >
    >
    Saravana, Jul 31, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mo
    Replies:
    1
    Views:
    4,181
    FFlannery
    Jan 30, 2004
  2. Henry
    Replies:
    1
    Views:
    381
    Frank Wisniewski
    Jul 21, 2004
  3. wh1974
    Replies:
    0
    Views:
    2,420
    wh1974
    Jan 12, 2005
  4. Red
    Replies:
    1
    Views:
    706
  5. pmanno

    DataGrid - Sorting & Paging

    pmanno, May 6, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    493
    John Timney \(ASP.NET MVP\)
    May 6, 2005
Loading...

Share This Page