473,322 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Make a row invisible/not be shown when string = "blabla"

After printing a userlist to a Datagrid i want some names not to be shown. I
want to know how i can make a entire datagrid row invisible.

I suspect its something with the OnItemDatabound but i am kinda stuck there.
but this is basicly what i want.

if Username = "Deleted_User" then
'make entire table row invisible.
End if

I hope someone can give me the code on how i can accomplish this. Thx in
advance.

Richard

Nov 18 '05 #1
3 2134
use this..
private void DataGrid1_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if((e.Item.FindControl("") as Label).Text == "Deleted_User")
e.Item.Visible = false;
}

Av.
"Richard" <ri*****@nospam.com> wrote in message
news:40***********************@newsreader.eweka.nl ...
After printing a userlist to a Datagrid i want some names not to be shown.
I
want to know how i can make a entire datagrid row invisible.

I suspect its something with the OnItemDatabound but i am kinda stuck
there.
but this is basicly what i want.

if Username = "Deleted_User" then
'make entire table row invisible.
End if

I hope someone can give me the code on how i can accomplish this. Thx in
advance.

Richard


Nov 18 '05 #2
Well, that didnt work for me. What i want is to make the entire row
invisible.

<asp:DataGrid ....... bla bla....>
<asp:BoundColumn DataField="U_Username" SortExpression="U_Username"
HeaderText="<strong>Username</strong>" />
<asp:BoundColumn DataField="A_LEVELNAAM" SortExpression="A_LEVELNAAM"
HeaderText="<strong>Level</strong>" />
<asp:BoundColumn DataField="U_Posts" SortExpression="U_Posts"
HeaderText="<strong>Posts</strong>" />
<asp:BoundColumn DataField="U_Registered_On"
SortExpression="U_Registered_On" HeaderText="<strong>Date
Registered</strong>" />
<asp:BoundColumn DataField="U_Last_Logged_In"
SortExpression="U_Last_Logged_In" HeaderText="<strong>Last Active</strong>"
/>
</columns>
</asp:DataGrid>

Whenever a username equels "Deleted_User" i would like that the entire row
would be invisible not only the username but every column.
If it's possible i'd like the example/code in VB. my C# aint good. :D

thx in advance Richard


"avnrao" <av*@newsgroups.com> schreef in bericht
news:uq**************@TK2MSFTNGP09.phx.gbl...
use this..
private void DataGrid1_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if((e.Item.FindControl("") as Label).Text == "Deleted_User")
e.Item.Visible = false;
}

Av.
"Richard" <ri*****@nospam.com> wrote in message
news:40***********************@newsreader.eweka.nl ...
After printing a userlist to a Datagrid i want some names not to be shown. I
want to know how i can make a entire datagrid row invisible.

I suspect its something with the OnItemDatabound but i am kinda stuck
there.
but this is basicly what i want.

if Username = "Deleted_User" then
'make entire table row invisible.
End if

I hope someone can give me the code on how i can accomplish this. Thx in
advance.

Richard



Nov 18 '05 #3
well i finally finished it :D

Sub myDataGrid_ItemDataBound(Sender As Object, e As DataGridItemEventArgs)
If e.Item.ItemType <> ListItemType.Header AND e.Item.ItemType <>
ListItemType.Footer then
Dim lblUsername As Label = E.Item.FindControl("lblUsername")
If NOT lblUsername Is Nothing then
If RTrim(lblUsername.Text) = "" OR RTrim(lblUsername.Text) =
"Deleted User" Then
e.item.Visible = False
End If
End If
End If
End Sub

this my code and it worked :D thx for your help avnrao.
"avnrao" <av*@newsgroups.com> schreef in bericht
news:uq**************@TK2MSFTNGP09.phx.gbl...
use this..
private void DataGrid1_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if((e.Item.FindControl("") as Label).Text == "Deleted_User")
e.Item.Visible = false;
}

Av.
"Richard" <ri*****@nospam.com> wrote in message
news:40***********************@newsreader.eweka.nl ...
After printing a userlist to a Datagrid i want some names not to be shown. I
want to know how i can make a entire datagrid row invisible.

I suspect its something with the OnItemDatabound but i am kinda stuck
there.
but this is basicly what i want.

if Username = "Deleted_User" then
'make entire table row invisible.
End if

I hope someone can give me the code on how i can accomplish this. Thx in
advance.

Richard



Nov 18 '05 #4

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

Similar topics

3
by: Gergely Varadi | last post by:
public class A : IComparable { int IComparable.CompareTo(object obj) { return 1; } } /// <summary> /// <see cref="A.System.IComparable.CompareTo"/>
5
by: lds | last post by:
I am getting the following error: The "SendUsing" configuration value is invalid. Description: An unhandled exception occurred during the execution of the current web request. Please review the...
9
by: David A. Beck | last post by:
When I do a debug.print("blabla") in VB (VS2005) it doesn't show up in the output window, what gives?
3
by: mr | last post by:
How can i 'force' c++ to interprete "blabla" strings as unicode string instead of ascii string (i just don't want to add 'L' before the thousands strings that are on my projects...), as all my...
13
by: Ragnar | last post by:
Hi, 2 issues left with my tidy-work: 1) Tidy transforms a "&amp;" in the source-xml into a "&" in the tidied version. My XML-Importer cannot handle it 2) in a long <title>-string a wrap is...
1
by: =?Utf-8?B?Sm9obg==?= | last post by:
I have a dropdownlist in masterpage and a big table in contentpage. When ddl selection changes, I want to move a specific row of the table to the top of the contentpage. Can I do something like <a...
11
by: kimiraikkonen | last post by:
Hi, Vb.net 2005 express i've been working, the problem is: I use openfiledialog to browse files, i created some code to execute file with OK button, no problem. But if i press "cancel" button as...
3
by: chriskaza81 | last post by:
helo all i have a string blablabla""blabla"" i want to make a space between two double qoates like blablabla" "blabla" " how can i do it in java .. i use replaceAll ...
3
by: krumblebunk | last post by:
Hello gurus, I am learning Python to take the place of Perl in my toolbox of bits and bobs, and writing something pretty simple in theory, but having a hard time in Python with it - I am using a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.