6
Answers

Checkbox null values

Dealy

Dealy

8y
326
1
Hello,
 
I have the following code that works if the values are true/false. If I have a null value I get an exception.
 
  1. <ItemTemplate>  
  2.     <asp:CheckBox ID="cbApproved" Checked='<%# Convert.ToBoolean(Eval(ValApproved")) %>' runat="server"/>  
  3. </ItemTemplate>  
 
Any ideas how to fix that?  
 
Thank you in advance. 
Answers (6)