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--;
}
}