eramgarden
Contributor
- Joined
- Mar 8, 2004
- Messages
- 579
I have a datagrid, with 4 columns.
In the code behind, i want , based on a condition, to remove 2 of the columns before binding..
I tried the following:
and this is the itemtemplate i have:
How can I remove a col from a datagrid??
In the code behind, i want , based on a condition, to remove 2 of the columns before binding..
I tried the following:
Code:
dg.DataSource = myDS 'bind dataset to the datagrid
[b] dg.FindControl("lblDesc").visible = false
' Also tried the one below
dg.items.item(1).visible = false [/b]
dg.DataBind()
and this is the itemtemplate i have:
Code:
<tr>
<td align="left"><b>Status:</b></td>
<td>
<asp:Label ID="lblDesc" Runat=server text='<%# Container.DataItem("incid_status_desc") %>'>
</asp:Label>
</td>
</tr>
How can I remove a col from a datagrid??