473,473 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Conditionally display DataGrid or DalaList content

Hi,

Is there a way to selectively display content of a DataGrid or DataList?
Normally I bind them to datareader or datatable, and they will display all
the rows, what if I don't want to display some of the rows.
Please don't tell me get rid of the rows from datareader or datatable,
that's not the answer I am looking for.

TIA
Nov 18 '05 #1
1 1415
Here is an untested idea:

Air code:

Private Sub dg_ItemDataBound(ByVal sender As System.Object, ByVal e As
DataGridItemEventArgs) Handles dg.ItemDataBound
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim oHyl1 As HyperLink = CType(e.Item.FindControl("hyl1"), HyperLink)
oHyl1.Visible=False
End If
End Sub

--
Joe Fallon

"Danny Ni" <dn**@yahoo.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi,

Is there a way to selectively display content of a DataGrid or DataList?
Normally I bind them to datareader or datatable, and they will display all
the rows, what if I don't want to display some of the rows.
Please don't tell me get rid of the rows from datareader or datatable,
that's not the answer I am looking for.

TIA

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sue | last post by:
Anyone have any ideas on why the code below will show up in a browser's sourcecode as an empty table, and is not visible? aspx: <headertemplate> <asp:Table ID="MyTable" runat="server" /> ...
0
by: CGuy | last post by:
Hi, I'm working on an ASPX page which has a DataGrid. This DataGrid is bound to a custom object. My requirement is that at rune time, I want the datagrid to display the items that match a...
18
by: Alpha | last post by:
Hi, I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a listbox that I have binded to a dataset table, "source" which has 3 columns. I would like to display 2 of those...
0
by: Amber | last post by:
There are times when you will need to highlight or otherwise modify the contents of a particular DataGrid row-column value based upon the value in the column. In this example we will select the...
3
by: | last post by:
One thing I did a lot of in Classic ASP involved showing page elements conditionally based on whether a user was logged in or not. Logged in users or "superusers" would get more content and/or more...
1
by: Tracey | last post by:
Hi, there My application requires to display multiline text in the cell of datagrid. I set the preferredheight of datagrid's tablsstyle, however, it is fixed. For text longer than that, the rest...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
7
by: lister | last post by:
Hi, I have a situation where I have a large block of HTML code that is conditionally displayed. In effect I have: html page some html <?php if (bShowBlock)
3
by: Yogesh Sharma | last post by:
I was asked in one of the interview-- Where We r use datagrid & Where we r use dalalist in our Application? I have fetched the data using the dataGrid, But I do not kno abt the DataList. ...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.