This is a migrated thread and some comments may be shown as answers.

[Solved] Chequed property of checkbox adding a new record

1 Answer 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Javier
Top achievements
Rank 1
Javier asked on 13 Apr 2009, 11:29 AM
Hi, I'm starting with the RadGrid control ...

I have a grid with several columns of type GridTemplateColumn

In this column, when i try to add a new record inplace, it returns me an error saying "The conversion of type 'DBNull' to type 'Boolean' is not valid."

<Telerik: GridTemplateColumn DataField = "Active" HeaderText = "Active" SortExpression = "Active"  UniqueName = "Active">
                 <itemtemplate>
                     <asp: CheckBox Enabled = "false" ID = "CheckboxlblActivo" runat = "server" Checked ='<%# Bind ( "Active")%> '>
                     </ asp: CheckBox>
                 </ ItemTemplate>
                 <EditItemTemplate>
                     <asp: CheckBox ID = "CheckboxActivo" runat = "server" Checked ='<%# Bind ( "Active")%> '>
                     </ asp: CheckBox>
                     </ EditItemTemplate>
</ Telerik: GridTemplateColumn>

How can I check that Bind ( "Active") is not null?  i'm adding a new record

<EditItemTemplate>
  <asp: CheckBox ID = "CheckboxActivo" runat = "server" Checked ='<%# Bind ( "Activo")%> '>
  </ asp: CheckBox>
</ EditItemTemplate>

Many thanks, any help o directions are appreciated

1 Answer, 1 is accepted

Sort by
0
Javier
Top achievements
Rank 1
answered on 13 Apr 2009, 12:05 PM
I solved this

Now i'm using a checkboxcolumn and i avoid this error.... 

<

 

Telerik:GridcheckboxColumn DataField="Activo" HeaderText="Activo" SortExpression="Activo"

 

 

UniqueName="Activo">

 

 

</Telerik:GridcheckboxColumn>

Solved! now i can add records

 

Tags
Grid
Asked by
Javier
Top achievements
Rank 1
Answers by
Javier
Top achievements
Rank 1
Share this question
or