Problem with Datagrid Sorting

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

    Problem with Datagrid Sorting

    Hi. I have a webform datagrid which should sort whenever the column is
    clicked. However, when the column is clicked no sorting occurs and the
    datagrid (with the exception of the header) disappears. My code to perform
    the datagrid sort is below. My datagrid's AllowSorting property is TRUE.
    Could someone please let me know how I can fix this code so that the datagrid
    sorts correctly? Thanks.

    Private Sub DataGrid1_SortC ommand(ByVal source As Object, _
    ByVal e As System.Web.UI.W ebControls.Data GridSortCommand EventArgs) _
    Handles DataGrid1.SortC ommand

    DataGrid1.DataS ource = DsLogs.spLogsSe lect.DefaultVie w.Sort
    DsLogs.spLogsSe lect.DefaultVie w.Sort = e.SortExpressio n
    DataGrid1.DataB ind()

    End Sub


    I've also read the following article to noavail

  • Brad Shook

    #2
    Re: Problem with Datagrid Sorting

    In the datagrid Property builder did you select the sort expression for each
    column?

    Brad Shook
    "MrMike" <MrMike@discuss ions.microsoft. com> wrote in message
    news:CF227CFF-2830-48FE-8423-9391B60232A3@mi crosoft.com...[color=blue]
    > Hi. I have a webform datagrid which should sort whenever the column is
    > clicked. However, when the column is clicked no sorting occurs and the
    > datagrid (with the exception of the header) disappears. My code to[/color]
    perform[color=blue]
    > the datagrid sort is below. My datagrid's AllowSorting property is TRUE.
    > Could someone please let me know how I can fix this code so that the[/color]
    datagrid[color=blue]
    > sorts correctly? Thanks.
    >
    > Private Sub DataGrid1_SortC ommand(ByVal source As Object, _
    > ByVal e As System.Web.UI.W ebControls.Data GridSortCommand EventArgs)[/color]
    _[color=blue]
    > Handles DataGrid1.SortC ommand
    >
    > DataGrid1.DataS ource = DsLogs.spLogsSe lect.DefaultVie w.Sort
    > DsLogs.spLogsSe lect.DefaultVie w.Sort = e.SortExpressio n
    > DataGrid1.DataB ind()
    >
    > End Sub
    >
    >
    > I've also read the following article to noavail:
    >[/color]



    Comment

    • MrMike

      #3
      Re: Problem with Datagrid Sorting

      Yes. Thanks.

      "Brad Shook" wrote:
      [color=blue]
      > In the datagrid Property builder did you select the sort expression for each
      > column?
      >
      > Brad Shook
      > "MrMike" <MrMike@discuss ions.microsoft. com> wrote in message
      > news:CF227CFF-2830-48FE-8423-9391B60232A3@mi crosoft.com...[color=green]
      > > Hi. I have a webform datagrid which should sort whenever the column is
      > > clicked. However, when the column is clicked no sorting occurs and the
      > > datagrid (with the exception of the header) disappears. My code to[/color]
      > perform[color=green]
      > > the datagrid sort is below. My datagrid's AllowSorting property is TRUE.
      > > Could someone please let me know how I can fix this code so that the[/color]
      > datagrid[color=green]
      > > sorts correctly? Thanks.
      > >
      > > Private Sub DataGrid1_SortC ommand(ByVal source As Object, _
      > > ByVal e As System.Web.UI.W ebControls.Data GridSortCommand EventArgs)[/color]
      > _[color=green]
      > > Handles DataGrid1.SortC ommand
      > >
      > > DataGrid1.DataS ource = DsLogs.spLogsSe lect.DefaultVie w.Sort
      > > DsLogs.spLogsSe lect.DefaultVie w.Sort = e.SortExpressio n
      > > DataGrid1.DataB ind()
      > >
      > > End Sub
      > >
      > >
      > > I've also read the following article to noavail:
      > >[/color]
      > http://msdn.microsoft.com/library/de...ridcontrol.asp
      >
      >
      >[/color]

      Comment

      Working...