eramgarden
Contributor
- Joined
- Mar 8, 2004
- Messages
- 579
I have a datagrid with ONE cell. In that ONE cell, I have a table with rows and columns...
I want, Depending on "MODE", hide the value bound to txtAdd18 ...
I tried: e.Item.Cells(0).Visible = False But this hides the WHOLE cell since i ONLY HAVE ONE CELL...
I also tried: e.Item.Cells(0).FindControl("txtAdd18").Visible = False But got an error that object is not set...
Anyway to do this without creating a new DataGrid for different Modes??
Code looks something like this:
I want, Depending on "MODE", hide the value bound to txtAdd18 ...
I tried: e.Item.Cells(0).Visible = False But this hides the WHOLE cell since i ONLY HAVE ONE CELL...
I also tried: e.Item.Cells(0).FindControl("txtAdd18").Visible = False But got an error that object is not set...
Anyway to do this without creating a new DataGrid for different Modes??
Code looks something like this:
Code:
<asp:datagrid id=... [b]OnItemDataBound="dg_hide"[/b]>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<table>
<tr>
<td> <%# Container.DataItem("Other9") %>
</td>
</tr>
<tr>
<td> <%# Container.DataItem("Other10") %>
</td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<tr><td>[b]<asp:Textbox id="txtAdd18"... />[/b]</td></tr>
<tr><td>...</td></tr>