I it very well may be the char vs string but I can't for the life of me
figure out the single quote setup in this context, as the bind string is
encapsulated with single
quotes
You solution worked when casting the eval to a string as in:
string.Compare((string)Eval("LocationType"), "P",false)==0?"Pickup":"Dropoff"
Thanks much!
"Karl Seguin [MVP]" wrote:
> Casing? Maybe this will do the trick:
>
> <%# string.Compare(Eval("LocationType"), "P", false) == 0 ? "Pickup" :
> "DropOff" %>
>
> you could also try with single quotes in your example...maybe it's a char
> <--> string thing, though I doubt it.
>
> Karl
>
>
> --
> http://www.openmymind.net/
> http://www.fuelindustries.com/
>
>
> "Dabbler" <> wrote in message
> news:824E63FA-2F62-40E0-B433-...
> > I'm trying to replace a user code in data column with user friendly text
> > for
> > a GridView ItemTemplate as in:
> >
> > Text='<%# Eval("LocationType")%> == "P" ? "Pickup" : "DropOff"'
> >
> > However the value always displays "DropOff" as if the binding doesn't
> > return
> > any P's but I know there are Ps in the rows I'm testing with.
> >
> > LocationType is defined as char(1) in the table.
> >
> > Any suggestion why this isn't working?
> >
> > Thanks.
>
>
>