473,756 Members | 2,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Ite ms.Count; i++)
{
dtlAuxiliar = ((DataList)
dtlVisaoMOL.Ite ms[i].FindControl("d tlTerminal"));
int Total = dtlAuxiliar.Ite ms.Count;
for (int x=0; x < Total; x++)
{
dtlAuxiliar.Ite ms[x].Attributes.Add ("style", "DISPLAY: none;");
Total--;
}
}
Nov 19 '05 #1
2 3649
First of all,

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

This code iterates for the half of the dtlAuxiliar.Ite ms.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******** ********@TK2MSF TNGP12.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.Ite ms.Count; i++)
{
dtlAuxiliar = ((DataList)
dtlVisaoMOL.Ite ms[i].FindControl("d tlTerminal"));
int Total = dtlAuxiliar.Ite ms.Count;
for (int x=0; x < Total; x++)
{
dtlAuxiliar.Ite ms[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******** ********@TK2MSF TNGP12.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.Ite ms.Count; i++)
{
dtlAuxiliar = ((DataList)
dtlVisaoMOL.Ite ms[i].FindControl("d tlTerminal"));
int Total = dtlAuxiliar.Ite ms.Count;
for (int x=0; x < Total; x++)
{
dtlAuxiliar.Ite ms[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
9120
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 Record (which is not neccesarily a database record..) but it'll be shown up as an ordinary item in the datalist rendered as an Item or AlternatingItem ... Is there a way to do this? Thanks
1
2474
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: When I click a item to be selected, the datalist applies the SelectedItemStyle on that Item, but not the SelectedItemTemplate. When I click the same Item a second time asp.net applies both the SelectedItemStyle and the SelectedItemTemplate, but does...
2
3950
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 binding syntax is standard: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MenuItems.DataSource = GetMyCustomIList MenuItems.DataBind()
3
9888
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> <asp:DataList> What I want to do is set the "pic=somenumber" querystring value
1
4677
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? Here is my code: <asp:DataList id=dlKommuner runat="server" Width="400px" RepeatColumns="2" CellPadding="3"> <AlternatingItemStyle Width="200px" CssClass="arow"> </AlternatingItemStyle>
1
2940
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: ------------------------------------------------------------------ <ASP:DataList id="MyDataList" RepeatColumns="3" runat="server"> <ItemTemplate> <table cellpadding="0" cellspacing="0">
5
13394
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 to get a Boolean value TRUE or FALSE when a checkBox is selected. When the checkBoxList was out of the DataList i used "OnSelectedIndexChanged" and it was returning what i wanted but if its in a
1
2569
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 when the user is looking at the data, the columns move back and forth among the DataLists. I don't know how well this will appear in text, but it looks something like: XXX XXXXX XXXXX XXX XXXX XXXXX
0
909
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. I tryed the visible property, everything. Tks in adv. Fabiano
0
9255
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10014
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9689
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8688
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6514
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3780
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 we have to send another system
2
3326
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2647
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.