hide/delete rows & the consequent page numbering problem

Discussion in 'ASP .Net Datagrid Control' started by Thomas Kopp, Mar 1, 2007.

  1. Thomas Kopp

    Thomas Kopp Guest

    Hi all;

    This is my first time on here (followed the link on DataGridGirl's site). I'm fairly experienced, but this one has me about to pull my hair out, something I can ill afford.

    I've bound a datasource to the grid. On the _ItemDataBound function, I'm determining, via a called function, whether this item should be displayed or not. That's okay, not a problem. I return a bool to the _ItemDataBoundfunction. I can hide the item (e.Item.Visible = false). However, that of course doesn't do anything else, so I have a variable number of items displayed on each page of the grid, with the number of pages remaining unchanged.

    You may ask why I am trying to do it this way. If, before the datagrid.databind(), I delete the datarows from the datasource via code, the process takes approximately twenty seconds. If I use a stored procedure to alter the datasource before I bind it, the time is about the same (the sp has 628 lines of code). I can't use a view because the original datasource is recursively created. Hiding items on the grid is the closest I've gotten to a reasonable solution (I can of course disable yet show the items, which will make the paging consistent with the display, but this would pretty much defeat the original purpose of what I'm trying to do, which is to conveniently display only records that fit a certain criteria).

    I've considered a couple strange and ugly methods which avoid any datatable/datasource manipulation (the deletion via code described above uses the same function as hiding the rows, but requires datatable operations). I've unsuccessfully tried substituting a DataRow array for the datatable that's the datasource hoping that would speed things up.

    The problem at this point is as described above: the grid is not repaged after the hides I the nature of items in the datagrid, so I know there's no straightforward way to do this, if there is any way at all. I'm following up on the SQL angle, but so far with no luck.

    Any help would be appreciated.

    Thanks!
    Thomas Kopp


    Thomas Kopp
    Distributed Programmer/Analyst
    Bureau of Health Licensure and Regulation
    615-532-4766
    -----------------------------------------------------------
    Our Mission -
    To promote, protect and improve the health of persons living in, working in, or visiting the State of Tennessee!
    -----------------------------------------------------------
    CONFIDENTIALITY NOTICE: The information contained in this email, and any attachments, is confidential and may be privileged. If you are not the intended recipient, please destroy this message, delete any copies held in your systems, and notify the sender immediately. You should not retain, copy or use this email for any purpose, nor disclose all or any of its content to any other person. We apologize for any inconvenience this may have caused.
    Thomas Kopp, Mar 1, 2007
    #1
    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. buran

    numbering rows in datagrid

    buran, Jul 7, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    462
    Saravana
    Jul 7, 2003
  2. buran

    numbering rows in datagrid

    buran, Oct 15, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    514
    Cowboy \(Gregory A. Beamer\)
    Oct 15, 2003
  3. buran

    numbering rows in datagrid

    buran, Jul 7, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    171
    Saravana
    Jul 7, 2003
  4. buran

    numbering rows in datagrid

    buran, Jul 7, 2003, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    153
    Saravana
    Jul 7, 2003
  5. buran

    numbering rows in datagrid

    buran, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    156
    Cowboy \(Gregory A. Beamer\)
    Oct 15, 2003
Loading...

Share This Page