Hi KEn
Line 136: <HEADERSTYLE VerticalAlign="Top"
HorizontalAlign="Center" Wrap="False"></HEADERSTYLE>
Line 137: <ITEMTEMPLATE>
Line 138: <asp:CheckBox ID="chkPosted" Runat="server"
checked='<%# IIF(Container.DataItem("Posted_Flag")=="Y","true","false")
%>' ></asp:CheckBox>
Line 139: </ITEMTEMPLATE>
Line 140: <EDITITEMTEMPLATE>
Source File: c:\inetpub\wwwroot\finance\FINANCE\TransactionPosting.aspx
Line: 138
Show Detailed Compiler Output:
CMicrosoft (R) Visual C# .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
c:\inetpub\wwwroot\finance\FINANCE\TransactionPosting.aspx(138,52):
error CS0118: 'System.Web.UI.WebControls.DataGridItem.DataItem' denotes
a 'property' where a 'method' was expected
c:\inetpub\wwwroot\finance\FINANCE\TransactionPosting.aspx(138,38):
error CS0103: The name 'IIF' does not exist in the class or namespace
'ASP.TransactionPosting_aspx'
What might be the problem?
Regards
thomson
Hi Thomson,
You can use an IIF() function to test the incoming value of Posted_flag and
then let it check or uncheck the box. Here's some code:
<asp:templatecolumn HeaderText="Y/N">
<itemtemplate>
<asp:checkbox id="Checkbox2" runat="server" Checked='<%#
IIF(Container.DataItem("Posted_flag")="Y","true","false") %>' >
</asp:checkbox>
</itemtemplate>
</asp:templatecolumn>
Let us know if this helps?
Ken
Microsoft MVP [ASP.NET]
Hi all,
Iam binding a datatable with the data grid, In the data table
there is a column as Posted_flag char(1), which can have value either N
or Y .
My issue is that in my grid there is a an
item template with a checkbox control, depending upon the value, Y or N
it should show checked or unchecked.
What should i do for this ?
Thanks in Advance
Thomson