G
Guest
I am having a hard time with this one, and I thought it would be easy.
I have a datagrid in which I have textboxs for users to enter data. One of
the fields in the database behind the datagrid tells me if the textbox is
readonly or not. I am having a hard time setting the readonly property of the
textbox with a conditional if statement (IIF).
Here is the coding;
<asp:TemplateColumn HeaderText="Data Entry">
<ItemTemplate>
<img src="images/Barrow.gif" onclick="CopyTotal(this);" title="Click here to
copy Previous Field to this text box">
<asp:TextBox CssClass="printableTextbox" runat="server"
onchange="AddRequesterName(this);" Readonly='<% #
iif(Container.DataItem("NotAllowed")=1,True,False) %>' id="txtDataEntry"
Text='<% # Format(Container.DataItem("Data"),"$#,##0.00") %>'
onblur="this.value=FormatCurrency(this.value,1);">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
What am I doing wrong with the readonly? If I look at the source, it isn't
being produced within the page.
Thank you,
Lyners
I have a datagrid in which I have textboxs for users to enter data. One of
the fields in the database behind the datagrid tells me if the textbox is
readonly or not. I am having a hard time setting the readonly property of the
textbox with a conditional if statement (IIF).
Here is the coding;
<asp:TemplateColumn HeaderText="Data Entry">
<ItemTemplate>
<img src="images/Barrow.gif" onclick="CopyTotal(this);" title="Click here to
copy Previous Field to this text box">
<asp:TextBox CssClass="printableTextbox" runat="server"
onchange="AddRequesterName(this);" Readonly='<% #
iif(Container.DataItem("NotAllowed")=1,True,False) %>' id="txtDataEntry"
Text='<% # Format(Container.DataItem("Data"),"$#,##0.00") %>'
onblur="this.value=FormatCurrency(this.value,1);">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
What am I doing wrong with the readonly? If I look at the source, it isn't
being produced within the page.
Thank you,
Lyners