locked
Specified cast is not valid. RRS feed

  • Question

  • User1402068600 posted

    Hi...

          I'm using telerik radgrid and bind some colume with boolean data type.I set boolean value to set check box and set that checkbox value to different icons.When i click insert button Specified cast is not valid exception message is came.

    My  checkbox source is   <asp:CheckBox ID="chkStatus" runat="server" Checked='<%# Eval("status") %>'></asp:CheckBox>       

                                                        What is the problem?

     

    Wednesday, March 10, 2010 12:29 AM

All replies

  • User-1812063630 posted

    Hi vinodkannan,

    please change the code as follows:

    you have to just change the datatype befor bind the data.


    <asp:CheckBox ID="chkStatus" runat="server" Checked='<%# Convert.ToBoolean(Eval("status").ToString())%>'></asp:CheckBox>  


    Please remember to click “Mark as Answer” on the post that helps you.

    This can be beneficial to other community members reading the thread.

    Wednesday, March 10, 2010 1:27 AM
  • User-1636183269 posted

    May be the reason boolean only work with 0,1,true and false. Instead of this any string will throw exception. so please check and take care.

    Wednesday, March 10, 2010 1:31 AM
  • User1402068600 posted

    Hi Pratik,

          I misssed case sensitive in my source.Now its working well.

                                                                                                              Thank you........

    Wednesday, March 10, 2010 1:58 AM
  • User1402068600 posted

    Hi Pratik,

                   I'm using telerik radgrid in my web form.When i add new row in this grid, the new irow only display in my grid.

    After click refresh button the full rows are display. Tel me the reason and modifications sir....Laughing 

    Thursday, March 11, 2010 12:27 AM
  • User1402068600 posted

    Hi Pratik,

                   I'm using telerik radgrid in my web form.When i update  row in this grid, the only display in my grid.

    After click refresh button the full rows are display. Tell me the reason and modifications sir....Laughing 

    Vino...

    Thursday, March 18, 2010 8:38 AM