Mar 07, 2013, 10:42 AM
[CLOSED] dynamic ID call from code behind
dear support,
i am creating a container in my code behind inside a loop for i need many.
i am setting a dynamic ID for each container created inside the loop.
how can i call the dynamic ID to use the Hidden="true/false" property.
here's a snippet.
thanks in advance
Michel
i am creating a container in my code behind inside a loop for i need many.
i am setting a dynamic ID for each container created inside the loop.
how can i call the dynamic ID to use the Hidden="true/false" property.
here's a snippet.
for (int i = 0; i < table.Rows.Count; i++)
{
Ext.Net.Container nbrFieldContainer = new Ext.Net.Container();
string nbrFieldContId = "nbrFieldContainer_" + i;
nbrFieldContainer.ID = nbrFieldContId;
nbrFieldContainer.Layout = "ColumnLayout";
Ext.Net.NumberField nbrField = new NumberField();
Ext.Net.Label lbl = new Ext.Net.Label();
nbrField.ID = "nbrField_" + i;
nbrField.Height = 30;
nbrField.Width = 100;
nbrField.MinValue = 1;
lbl.ID = "nbrId_" + i;
lbl.StyleSpec = "margin-left:10px";
lbl.Text = "Days";
nbrFieldContainer.Items.Add(nbrField);
nbrFieldContainer.Items.Add(lbl);
nbofdays.Component.Add(nbrFieldContainer);
if (table.Rows[i]["Value"].ToString() != "" && userSettingsTable.Rows[i]["value"].ToString() != "0")
{
//I NEED TO SHOW THE CONTAINER OF ID ("nbrFieldContainer_" + i )
}
else
{
//I NEED TO HIDE THE CONTAINER OF ID ("nbrFieldContainer_" + i )
}
}
please note that the conditions inside my conditional statements are correct. i just need to set an ID.Hidden to true or false.thanks in advance
Michel
Last edited by Daniil; Mar 12, 2013 at 5:41 AM.
Reason: [CLOSED]