Hi all,
I have a data grid which is being displayed on my web page. The datagrid is generated by a stored procedure like the one below.
The first and last rows are dummy rows and I need to Permanently show or hide these rows depending on the number or rows returned in between.
i.e. if row 2 passes a condtion then I want to hide row one once the screen loads.
Does anyone know if there is a way this can be done.
I'm using a Query with UNION in it like the this one below. Is it possible to remove the first and last rows in the Query if a certain condtion passed or can this be done in in the vb.net code when I'm binding the datagrid
SELECT Bookname, 1 AS VERSION, COUNT(*) OVER () AS totalRows FROM book WHERE bookname = 'doctor Who' UNION SELECT Bookname, VERSION, COUNT(*) OVER () AS totalRows FROM tablebook WHERE bookname = 'Harry potter' UNION SELECT Bookname, 20 AS VERSION, COUNT(*) OVER () AS totalRows FROM book WHERE bookname = 'Witches and wizards'
Results
BookName VERSION totalRows Doctor Who 1 1 Harry potter 1 3 Harry potter 2 3 Harry potter 3 3 Witches AND wizards 1 20
|
| Author: kumar 06 Nov 2006 | Member Level: Diamond | Rating: Points: 2 |
Hi,
for hiding the row in datagrid
You can use a DataView, bind the datagrid to the dataview, set the filter in the dataview to filter the rows you want to hide.
Plz Refer
http://www.dotnetspider.com/kb/Article2696.aspx
thanks and regards, kumar
|