![]() |
hide/delete rows & the consequent page numbering problem
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. |
| All times are GMT. The time now is 04:34 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.