473,405 Members | 2,338 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,405 software developers and data experts.

Hidding a Item (Column) of a DataList

Please,

i need to hide a Item(Collumn) of a DataList that is inside of another
DataList based on some data that i my database returns. For a sample i
created the code above, but it doesn't work. I tryed the visible property,
everything.

Tks in adv.

Fabiano
DataList dtlAuxiliar = new DataList();
for (int i=0; i < dtlVisaoMOL.Items.Count; i++)
{
dtlAuxiliar = ((DataList)
dtlVisaoMOL.Items[i].FindControl("dtlTerminal"));
int Total = dtlAuxiliar.Items.Count;
for (int x=0; x < Total; x++)
{
dtlAuxiliar.Items[x].Attributes.Add("style", "DISPLAY: none;");
Total--;
}
}
Nov 19 '05 #1
2 3625
First of all,

int Total = dtlAuxiliar.Items.Count;
for (int x=0; x < Total; x++)
{
dtlAuxiliar.Items[x].Attributes.Add("style", "DISPLAY: none;");
Total--;
}

This code iterates for the half of the dtlAuxiliar.Items.Count.
It is C# behaviour. This behaviour differs on programming languages. And C#
every time checks condition like C++. It makes for a bit slower. It is
another subject to discuss. I wanna to concentrate on your problem.

U modify datalist items visibilty but next round trip all this properties
gone. My advice u to modify datasource of your datalist... Try to filter
datalist' datasource..
--
HTH

Thanks,
Yunus Emre ALPÖZEN
BSc, MCSD.NET

"Fabiano" <aa@aa.comaa> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Please,

i need to hide a Item(Collumn) of a DataList that is inside of another
DataList based on some data that i my database returns. For a sample i
created the code above, but it doesn't work. I tryed the visible property,
everything.

Tks in adv.

Fabiano
DataList dtlAuxiliar = new DataList();
for (int i=0; i < dtlVisaoMOL.Items.Count; i++)
{
dtlAuxiliar = ((DataList)
dtlVisaoMOL.Items[i].FindControl("dtlTerminal"));
int Total = dtlAuxiliar.Items.Count;
for (int x=0; x < Total; x++)
{
dtlAuxiliar.Items[x].Attributes.Add("style", "DISPLAY: none;");
Total--;
}
}

Nov 19 '05 #2

Please,

i need to hide a Item(Collumn) of a DataList that is inside of another
DataList based on some data that i my database returns. For a sample i
created the code above, but it doesn't work. I tryed the visible property,
everything.

Tks in adv.

Fabiano


"Fabiano" <aa@aa.comaa> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Please,

i need to hide a Item(Collumn) of a DataList that is inside of another
DataList based on some data that i my database returns. For a sample i
created the code above, but it doesn't work. I tryed the visible property,
everything.

Tks in adv.

Fabiano
DataList dtlAuxiliar = new DataList();
for (int i=0; i < dtlVisaoMOL.Items.Count; i++)
{
dtlAuxiliar = ((DataList)
dtlVisaoMOL.Items[i].FindControl("dtlTerminal"));
int Total = dtlAuxiliar.Items.Count;
for (int x=0; x < Total; x++)
{
dtlAuxiliar.Items[x].Attributes.Add("style", "DISPLAY: none;");
Total--;
}
}


__________________________________________________ _____________________________
Posted Via Uncensored-News.Com - Accounts Starting At $6.95 - http://www.uncensored-news.com
<><><><><><><> The Worlds Uncensored News Source <><><><><><><><>

Nov 19 '05 #3

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

Similar topics

6
by: Umut K. | last post by:
Hi all, I've a DataList control and it's DataBound by a SqlDataReader... The Reader returns say 3 records and as expected the datalist shows 3 rows. What i want to do is to add another extra...
1
by: Dirk Meusel | last post by:
Background: On my webform a simple datalist shows one column. The databind is done in the page_load event. In the ItemTemplate a linkbutton serves for providing the Select Command. Problem:...
2
by: Kel Good | last post by:
Hello, I am binding a custom IList object to a DataList that I am using for a web menu. The items in the custom IList have properties that allow me to dynamically define how my menu behaves. My...
3
by: Stimp | last post by:
I have a datalist that outputs a link to a picture in each ItemTemplate: e.g. <asp:DataList id="DataList1" ...etc> <ItemTemplate> <a href='Pic.aspx?pic=somenumber'>picture</a> </ItemTemplate>...
1
by: Eirik Eldorsen | last post by:
I'm trying to set alternating bgcolor for a datalist with 2 columns. My problem is that its the alternating cell that get the bgcolor, not the row. Is it possible to set alternating color of rows?...
1
by: lydia sista via DotNetMonster.com | last post by:
hi! help... How do you show/hide item's data? Like sale item on product catalogue. I want to show the sale image when the status of product is on sale. in my catalogue I use datalist:...
5
by: Patrick.O.Ige | last post by:
I'm binding a CheckBoxlist below in the ItemDataBound(the CheckBoxList is in a Datalist) By doing "li.Selected = True" i can see all the checkBoxes are selected. But what i want is to be able...
1
by: Rachel Devons | last post by:
All, I have a table with three rows, and within each row I have a DataList that is set to use 3 columns. The problem I'm having is that each DataList sets it's columns to be different widths so...
0
by: Fabiano | last post by:
Please, i need to hide a Item(Collumn) of a DataList that is inside of another DataList based on some data that i my database returns. For a sample i created the code above, but it doesn't work....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.