S
SP
Hello there,
I have a DataList create as below.
<aspataList ID="dl_Immunpsuppressive_Main" Runat="server"
Width="100%">
<ItemTemplate>
<table id="Immunpsuppressive_Main" width="100%" border="0">
<tr>
<td class="sub" width="50%" colSpan="2">
<asp:Label ID="lbl_Imm_Main" Runat="server">
<%#((System.Data.DataRow)Container.DataItem)["MetaDataChoiceText"] %>
</asp:Label>
<asp:TextBox ID="txt_Imm_Main_Other" Runat="server" Width="150px"
Visible="False" ></asp:TextBox>
</td>
<td class="sub" width="5%" colSpan="1">
<asp:CheckBox ID="chk_Ind" Runat="server"></asp:CheckBox></td>
<td class="sub" width="19%" colSpan="1">
<asp:TextBox ID="txt_Days" Runat="server" Width="96px"></asp:TextBox>
</td>
<td class="sub" width="19%" colSpan="1">
<aspropDownList ID="ddl_ST" Runat="server"
Width="96px"></aspropDownList>
</td>
<td class="sub" width="5%" colSpan="1">
<asp:CheckBox ID="chk_Maint" Runat="server"></asp:CheckBox></td>
<td class="sub" width="5%" colSpan="1">
<asp:CheckBox ID="chk_AR" Runat="server"></asp:CheckBox></td>
</tr>
</table>
</ItemTemplate>
</aspataList>
I need to make the TExtBox Control "txt_Imm_Main_Other" visible only
when it meets a particular condition:
I have the following code in my DataList ItemDataBound
TextBox txt_Imm_Main_Other =
(TextBox)e.Item.FindControl("txt_Imm_Main_Other");
if (txt_Imm_Main_Other != null)
{
MetaDataDAC metaDataDAC_Imm = new MetaDataDAC();
DataSet ds_Imm = metaDataDAC_Imm.Get(1, 2, null);
foreach(DataTable dt_Table in ds_Imm.Tables)
{
foreach (DataRow dr_Row in dt_Table.Rows)
{
if (dr_Row["MetaDataChoiceVal"].ToString() == "4")
{
txt_Imm_Main_Other.Visible = true;
txt_Imm_Main_Other.Enabled = true;
}
}
}
}
The TExtBox Control "txt_Imm_Main_Other" always is visible?
Please suggest!
Thanks,
Pai
I have a DataList create as below.
<aspataList ID="dl_Immunpsuppressive_Main" Runat="server"
Width="100%">
<ItemTemplate>
<table id="Immunpsuppressive_Main" width="100%" border="0">
<tr>
<td class="sub" width="50%" colSpan="2">
<asp:Label ID="lbl_Imm_Main" Runat="server">
<%#((System.Data.DataRow)Container.DataItem)["MetaDataChoiceText"] %>
</asp:Label>
<asp:TextBox ID="txt_Imm_Main_Other" Runat="server" Width="150px"
Visible="False" ></asp:TextBox>
</td>
<td class="sub" width="5%" colSpan="1">
<asp:CheckBox ID="chk_Ind" Runat="server"></asp:CheckBox></td>
<td class="sub" width="19%" colSpan="1">
<asp:TextBox ID="txt_Days" Runat="server" Width="96px"></asp:TextBox>
</td>
<td class="sub" width="19%" colSpan="1">
<aspropDownList ID="ddl_ST" Runat="server"
Width="96px"></aspropDownList>
</td>
<td class="sub" width="5%" colSpan="1">
<asp:CheckBox ID="chk_Maint" Runat="server"></asp:CheckBox></td>
<td class="sub" width="5%" colSpan="1">
<asp:CheckBox ID="chk_AR" Runat="server"></asp:CheckBox></td>
</tr>
</table>
</ItemTemplate>
</aspataList>
I need to make the TExtBox Control "txt_Imm_Main_Other" visible only
when it meets a particular condition:
I have the following code in my DataList ItemDataBound
TextBox txt_Imm_Main_Other =
(TextBox)e.Item.FindControl("txt_Imm_Main_Other");
if (txt_Imm_Main_Other != null)
{
MetaDataDAC metaDataDAC_Imm = new MetaDataDAC();
DataSet ds_Imm = metaDataDAC_Imm.Get(1, 2, null);
foreach(DataTable dt_Table in ds_Imm.Tables)
{
foreach (DataRow dr_Row in dt_Table.Rows)
{
if (dr_Row["MetaDataChoiceVal"].ToString() == "4")
{
txt_Imm_Main_Other.Visible = true;
txt_Imm_Main_Other.Enabled = true;
}
}
}
}
The TExtBox Control "txt_Imm_Main_Other" always is visible?
Please suggest!
Thanks,
Pai