Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

truncated gridview

Options
  • 14-05-2007 3:36pm
    #1
    Closed Accounts Posts: 5,284 ✭✭✭


    Using asp.net 2.0 with vb.
    A gridview is truncated sometimes when the page loads/refreshes etc - it is like the page doesn't load fully.
    The gridview contains a lot of records. Setting a page size to 10 seems to fix it, but that doesn't fit the requirements, and pages of 200, for example, still result in the problem.
    This has started happening since I added a datestamp to updates in the gridview.
    I've implemented this before in the follwoing manner: When the user clicks the update button, the text of a label on the page is set to the date/time and this label is used as an update parameter in the update statement.
    It's on an intranet where I've made other pages that show greater numbers of records and have similar functionality.
    Does anyone know what might be going on?
    Any ideas appreciated
    Thanks.


Comments

  • Registered Users Posts: 2,931 ✭✭✭Ginger


    More than likely the viewstate.,,, Use the method onItemBound (i think) set the ViewState = False

    That should clear it up


  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    I tried each of the following and none of them solved the problem:


    Protected Sub GridView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)
    GridView1.EnableViewState = False
    End Sub

    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
    GridView1.EnableViewState = False
    End Sub

    Protected Sub GridView1_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)
    GridView1.EnableViewState = False
    End Sub


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    What physical size is the page when its downloaded?


  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    266k when it is not truncated
    311k when it was truncated - also it said "this page might not save correctly" when I downloaded the truncated version.
    different pages were displayed on the gridview for the truncated and non-truncated versions.
    odd that the truncated one is larger.


  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    also if you open the html file from the truncated versioin, it shows the whole page correctly - it is not truncated in this version.


  • Advertisement
  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    and it seems to work fine in firefox portable


  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    well I still don't know what the problem was, but I redid it in a new page and it seems grand now.
    Thanks for your responses.


Advertisement