-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: SadhanaNaren
Message 3 in Discussion
Hi This is possible. I had a situation where i had to make either a checkbox or a
label visible depending upon the dataset returned at runtime. You write two functions
as follows:
protected bool GetLabelVisible(string Type)
{
if(System.Int32.Parse(Type)==5)
return false;
else
return true;
}
protected bool GetCheckBoxVisible(string Type)
{
if(System.Int32.Parse(Type)==5)
return true;
else
return false;
}
where if Type = 5 only then the checkbox is to be made visible and in all other cases,
the label is to be made visible.
<ITEMSTYLE CssClass="LTCell"></ITEMSTYLE> <ITEMSTYLE CssClass="LTCell"></ITEMSTYLE>
<ItemTemplate>
<asp:Label ID="Label1" Runat=server Visible='<%#
GetLabelVisible(Convert.ToString(((System.Data.DataRowView)
Container.DataItem["ID"]))%>'>
</asp:Label>
<asp:CheckBox ID="CheckBox1" Runat=server Visible='<%#
GetCheckBoxVisible(Convert.ToString(((System.Data.DataRowView)
Container.DataItem)["ID"]))%>' Checked='<%#
Convert.ToBoolean(DataBinder.Eval(Container, "DataItem.Id")) %>'>
</asp:CheckBox><ITEMTEMPLATE><asp:Label id=LabelSum Visible='<%#
GetLabelVisible(Convert.ToString(((System.Data.DataRowView)
Container.DataItem)["LineTypeID"]))%>' Runat="server"></asp:Label><asp:CheckBox
id=CheckBoxSum Visible='<%#
GetCheckBoxVisible(Convert.ToString(((System.Data.DataRowView)
Container.DataItem)["LineTypeID"]))%>' Runat="server" Checked='<%#
Convert.ToBoolean(DataBinder.Eval(Container, "DataItem.SumInd"))
%>'></asp:CheckBox><ITEMTEMPLATE><asp:Label id=LabelSum Visible='<%#
GetLabelVisible(Convert.ToString(((System.Data.DataRowView)
Container.DataItem)["LineTypeID"]))%>' Runat="server"></asp:Label><asp:CheckBox
id=CheckBoxSum Visible='<%#
GetCheckBoxVisible(Convert.ToString(((System.Data.DataRowView)
Container.DataItem)["LineTypeID"]))%>' Runat="server" Checked='<%#
Convert.ToBoolean(DataBinder.Eval(Container, "DataItem.SumInd")) %>'></asp:CheckBox>
Hope this answers ur question.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]