DataGrid - sorting/paging problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hajime Kusakabe

    #1

    DataGrid - sorting/paging problem

    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 myBoundColumnEn tryBy As New BoundColumn()
    myBoundColumnEn tryBy.DataField = "Entry By"
    myBoundColumnEn tryBy.SortExpre ssion = "Entry By"
    myBoundColumnEn tryBy.HeaderTex t = "Entry By"
    DataGrid1.Colum ns.Add(myBoundC olumnEntryBy)

    DataGrid1.DataS ource = dv ' dv is a dataview.
    DataGrid1.Curre ntPageIndex = 0
    DataGrid1.DataB ind()
    =============== =============== ====

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

    Any idea?

    Thanks.
    Haji


  • Hajime Kusakabe

    #2
    Re: DataGrid - sorting/paging problem

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

    When I click for sorting it does not get the subroutine
    "DataGrid1_Sort Command" 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" <hajime.kusakab e@eimcoprocess. com> wrote in message
    news:OMOhaBuVDH A.424@TK2MSFTNG P11.phx.gbl...[color=blue]
    > 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 myBoundColumnEn tryBy As New BoundColumn()
    > myBoundColumnEn tryBy.DataField = "Entry By"
    > myBoundColumnEn tryBy.SortExpre ssion = "Entry By"
    > myBoundColumnEn tryBy.HeaderTex t = "Entry By"
    > DataGrid1.Colum ns.Add(myBoundC olumnEntryBy)
    >
    > DataGrid1.DataS ource = dv ' dv is a dataview.
    > DataGrid1.Curre ntPageIndex = 0
    > DataGrid1.DataB ind()
    > =============== =============== ====
    >
    > Everything working except Sorting/Paging features.
    > When I click the sorting or paging the whole datagrid disappear.
    >
    > Any idea?
    >
    > Thanks.
    > Haji
    >
    >[/color]


    Comment

    • Saravana

      #3
      Re: DataGrid - sorting/paging problem

      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" <hajime.kusakab e@eimcoprocess. com> wrote in message
      news:OMOhaBuVDH A.424@TK2MSFTNG P11.phx.gbl...[color=blue]
      > 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 myBoundColumnEn tryBy As New BoundColumn()
      > myBoundColumnEn tryBy.DataField = "Entry By"
      > myBoundColumnEn tryBy.SortExpre ssion = "Entry By"
      > myBoundColumnEn tryBy.HeaderTex t = "Entry By"
      > DataGrid1.Colum ns.Add(myBoundC olumnEntryBy)
      >
      > DataGrid1.DataS ource = dv ' dv is a dataview.
      > DataGrid1.Curre ntPageIndex = 0
      > DataGrid1.DataB ind()
      > =============== =============== ====
      >
      > Everything working except Sorting/Paging features.
      > When I click the sorting or paging the whole datagrid disappear.
      >
      > Any idea?
      >
      > Thanks.
      > Haji
      >
      >[/color]


      Comment

      Working...