You shouldn't need the .ToString()
or the Convert.ToBoolean()
; .NET will pretty much do that under the hood for you.
Visible='<%# Eval("IsLockedOut") %>'
What do you see if you add a <asp:Label />
to your ItemTemplate
and bind the Text
property as the above? Is your IsLockedOut
property a Nullable<Boolean>
? If it is, you could try this:
Visible = '<%# Eval("IsLockedOut") ?? true %>'
Or
Visible = '<%# ((Nullable<bool>)Eval("IsLockedOut")).GetValueOrDefault(true) %>'