Results 1 to 2 of 2

Thread: Datagrid tricks...please help

  1. #1

    Thread Starter
    Fanatic Member drpcken's Avatar
    Join Date
    Apr 2004
    Location
    devenv
    Posts
    591

    Datagrid tricks...please help

    I got the data in my datagrid, now I have paging setup, but when I page to the next sheet, it doesn't want to go, it stays on the first page. What am I missing??

    Also, I'd like to be able to select a row by clicking anywhere, I use to do it by making a LinkButton in the first column (0) and pasting this code:

    Private Sub dgRecs_ItemDataBound(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
    Dim itemType As ListItemType = e.Item.ItemType
    If ((itemType = ListItemType.Pager) Or _
    (itemType = ListItemType.Header) Or _
    (itemType = ListItemType.Footer)) Then
    Return
    Else
    Dim button As LinkButton = _
    CType(e.Item.Cells(0).Controls(0), LinkButton)
    e.Item.Attributes("onclick") = _
    Page.GetPostBackClientHyperlink(button, "")
    End If

    End Sub


    Only its not working anymore after I made some changes. Is there another way? Thanks again guys!!!!

  2. #2

    Thread Starter
    Fanatic Member drpcken's Avatar
    Join Date
    Apr 2004
    Location
    devenv
    Posts
    591

    Paging

    As for the paging, i found this on MSDN

    Private Sub dgRecs_PageIndexChanged(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs)
    dgRecs.CurrentPageIndex = e.NewPageIndex
    DataBind()
    End Sub


    But it still won't page

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width