Eval always returns a string. So, when we are using Eval to set a text property, no cast is necessary, because the Text property of a control takes a string.
However, the Visible property of a control takes a boolean value. Eval("Approved") returns either the string "true" or the string "false". Therefore, that string output must be cast to a bool in order to use it to set the Visible property.
In this case, the string "true" would be cast to the Boolean value TRUE, and the string "false" would be cast to the Boolean value FALSE.
|