0

I'm thinking this should be possible or something like it:

<td <%# "style=" DataBinder.Eval(Container.DataItem, "CustName") == "T" ? "border:none" : "border:solid"%>>

But it's not doing it for me.

Is there a way to do this?

Thanks!

user259286
  • 977
  • 3
  • 18
  • 38

2 Answers2

0

I am not sure but try this

<td <%# string.Format("style={0}, Eval("CustName") == "T" ? 
    "border:none":"border:solid")%> >

or Create a public method on the cs file like this

protected string GetStyle()
{
   var dt = SomeMethod();
   If (string.compare("T",dt.rows[idx][idx].Tostring(),false)==0)
    return "border:none";
   return "border:solid";
}

user:

 <td <%# string.Format("style={0}, GetStyle())%> >
0

I don't know if you can do that, but you can try this instead:

<td style='<%# Eval("CustName") == "T" ? "border:none" : "border:solid"%>'>

</td>
James Johnson
  • 45,496
  • 8
  • 73
  • 110