R
Raghu Raman
Hi,
am using the datagrid with the item template property.Inside it i have
the check box bounded to my database.I want the check box to be
automatically checked when it is loaded.
so i used the following code,
<Columns>
<asp:BoundColumn DataField="Tid" HeaderText="SI No"></asp:BoundColumn>
<asp:BoundColumn DataField="Tname" HeaderText="Name"></asp:BoundColumn>
<asp:TemplateColumn><ItemTemplate> <asp:CheckBox ID="chk" Runat=server
Checked ='<%#Container.DataItem("bools")%>'/>
</ItemTemplate> </asp:TemplateColumn>
</Columns>
-----------------------------id i run my app,
It tells the following error.
Compiler Error Message: CS0118:
'System.Web.UI.WebControls.DataGridItem.DataItem' denotes a 'property'
where a 'method' was expected
Source Error:
Line 23: using System.Web.UI.WebControls;
Line 24: using System.Web.UI.HtmlControls;
Line 25: using ASP;
Line 26:
Line 27:
----------------------------
Table structure:
~~~~~~~~~~~~~~~~~~~~~`
Tid Tname bools (nvarchar(5))
----------- -------------------- -----
1 one TRUE
2 two TRUE
6 six TRUE
Could u pls tell where i went wrong.
Thx & Regards
Raghu
am using the datagrid with the item template property.Inside it i have
the check box bounded to my database.I want the check box to be
automatically checked when it is loaded.
so i used the following code,
<Columns>
<asp:BoundColumn DataField="Tid" HeaderText="SI No"></asp:BoundColumn>
<asp:BoundColumn DataField="Tname" HeaderText="Name"></asp:BoundColumn>
<asp:TemplateColumn><ItemTemplate> <asp:CheckBox ID="chk" Runat=server
Checked ='<%#Container.DataItem("bools")%>'/>
</ItemTemplate> </asp:TemplateColumn>
</Columns>
-----------------------------id i run my app,
It tells the following error.
Compiler Error Message: CS0118:
'System.Web.UI.WebControls.DataGridItem.DataItem' denotes a 'property'
where a 'method' was expected
Source Error:
Line 23: using System.Web.UI.WebControls;
Line 24: using System.Web.UI.HtmlControls;
Line 25: using ASP;
Line 26:
Line 27:
----------------------------
Table structure:
~~~~~~~~~~~~~~~~~~~~~`
Tid Tname bools (nvarchar(5))
----------- -------------------- -----
1 one TRUE
2 two TRUE
6 six TRUE
Could u pls tell where i went wrong.
Thx & Regards
Raghu