I want to display an additional <tr><td> <?# Eval("DataValue") %> </td></tr>
if the value of another Eval() data item is not null.
I have the following aspx:
<%# Eval(TwoColumns).ToString() == null ? " " : Eval(Column2Data).ToString() %>
Is this possible? I get the following databinding error: does not contain a property with the name 'true'.
Any ideas on how to do this?
I'm a little unsure of what you're asking, but try something like this:
<%# Eval("SomeColumn") == DBNull.Value ? " " : Eval("AnotherColumn") %>
If this doesn't help, edit your question and give a more detailed description of the issue and the objective.
EDIT
As for appending a row and a column, you can try this:
<%# Eval("SomeColumn") == DBNull.Value ? " " : String.Format("<tr><td>{0}</td></tr>", Eval("AnotherColumn")) %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With