Inside as datagrid control you can use the 'IIf([expression], True, False)'
function...
Any function calls in either the 'TruePart or Falsepart' will be called
regardless of the value of [expression]
I use this to toggle the 'visible' attribute in <asp:image /> controls in a
datagrid or datalist like so....
<asp:image id="imgLogo" imageUrl='<%# Container.DataItem("picpath") %>'
visible='<%# IIf(Container.DataItem("picpath") Is DbNull.Value, "False",
"True") %>' />
This IIf() function toggles the image visible to 'False' if "picpath" is
DbNull.Value, else it displays if there is a value in "picpath"
Severin
"Trevor Hartman" <sy******@hotmail.com> wrote in message
news:uU**************@TK2MSFTNGP10.phx.gbl...
hi,
I want to display certain data in my edititemtemplate in the datagrid
based on the value of a column. How do I do an if then inside the datagrid AND
test the value of the current column. i only know how to refer to columsn
with the <%# DataBinder.Eval(Container.DataItem, "column") %>, and i can't
include an if then in the <%# %> block. any suggestions?
thanks
-trevor