Hi All,
Have a Radgrid with a record in Check box.
AutomaticInsert="False"
AutomaticUpdate= "False"
AutomaticDelete = "False"
When Edit is clicked Works fine.
When Add New Recod is clicked Error appears
Object cannot be cast from DBNull to other types.
In the Check Box.
The Problem is while Add New Record, The Earning has the value NULL, How to rectify this.
-Anto
Have a Radgrid with a record in Check box.
AutomaticInsert="False"
AutomaticUpdate= "False"
AutomaticDelete = "False"
When Edit is clicked Works fine.
When Add New Recod is clicked Error appears
<telerik:GridTemplateColumn HeaderText="Is Earning?" UniqueName="Earning" |
DataField="Earning" SortExpression="Earning"> |
<ItemStyle HorizontalAlign="Center" Width="10%" /><%--Width="70px"--%> |
<HeaderStyle HorizontalAlign="Center" /> |
<ItemTemplate> |
<asp:CheckBox ID="chkEarning" runat="server" Enabled="false" |
Checked='<%# Convert.ToBoolean(Eval("Earning")) %>'></asp:CheckBox> |
</ItemTemplate> |
<EditItemTemplate> |
<asp:CheckBox ID="chkEarningEdit" runat="server" |
Checked='<%# Convert.ToBoolean(Eval("Earning")) %>'></asp:CheckBox> |
</EditItemTemplate> |
</telerik:GridTemplateColumn> |
Object cannot be cast from DBNull to other types.
In the Check Box.
The Problem is while Add New Record, The Earning has the value NULL, How to rectify this.
-Anto