Dealy

Dealy

  • NA
  • 213
  • 0

Checkbox null values

Aug 17 2016 6:32 AM
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)