I have a GridCheckBoxColumn in my RadGrid. This column is bound to "Bit" type field in the SQL Server. I can sucessfully Insert and Edit the item in In-Place and Auto Generated Form Type modes.
However when I use Template in EditFormType then I can only Edit the item succssfully, but Insert throws an exception as shown below:
The Exception points to this block of code:
<asp:CheckBox ID="CheckBox1" runat="server" DataType="System.Boolean" Checked="<%# Bind('IsActive') %>" />
The Exception box contains this text:
InvalidCastException was unhandled by user code
Specified cast is not valid
However when I use Template in EditFormType then I can only Edit the item succssfully, but Insert throws an exception as shown below:
The Exception points to this block of code:
<asp:CheckBox ID="CheckBox1" runat="server" DataType="System.Boolean" Checked="<%# Bind('IsActive') %>" />
The Exception box contains this text:
InvalidCastException was unhandled by user code
Specified cast is not valid
I would assume that when the Item is called for Editing the bound field has either True or False as its value. However upon Insertion the bound field is NULL at that stage, and therefore the Checkbox throws this exception. This is just my assuption and could be wrong.
Please guide me how to fix this problem.
Tariq