C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




datagrid ????


Posted Date: 06 Nov 2006      Total Responses: 1

Posted By: Chrisc       Member Level: Bronze     Points: 2


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




Responses

Author: kumar    06 Nov 2006Member Level: DiamondRating:     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


Post Reply
You must Sign In to post a response.
Next : Timer control using javascript in asp.net
Previous : Pls give me good site for statemanagement?
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

accuconference

Contact Us    Privacy Policy    Terms Of Use