Cannot insert null value error when using ReadOnly="True"

11 posts, 0 answers
  1. Stavros
    Stavros avatar
    89 posts
    Member since:
    Sep 2008

    Posted 08 Dec 2008 Link to this post

    I have a master table with detail tables below.

    In the <DetailTables>
            <Columns>

    I have a gridbound column which is also the key to the relation beween parent and child.
    The problem is that I I set it to readonly="true" so that it does not appear when inserting a record when I press insert
    I get an error telling me that the program cannot insert a null value into the database.
    Any ideas?
    Thank you!

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Dec 2008 Link to this post

    Hi Stavros,

    If you are using Automatic operations you can use the ForceExtractValue  property.


    "RadGrid can extract values from columns that are set as read-only, if the column's ForceExtractValue property is set to:
    "InBrowseMode" - when deleting records
    "InEditMode" - when inserting or updating records
    "Always" - for all modes
    The default value for the ForceExtractValue property is "None", which means that the extraction of default values will not be performed for read-only columns."


    Thanks,
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stavros
    Stavros avatar
    89 posts
    Member since:
    Sep 2008

    Posted 08 Dec 2008 Link to this post

    I added readonly="true" again and I laso added 

    ForceExtractValue

     

    ="InEditMode"

    but I get again the same null error.
    Am I doing something wrong?

    I even tried always mode but the error remains. 

     

  5. Stavros
    Stavros avatar
    89 posts
    Member since:
    Sep 2008
  6. Stavros
    Stavros avatar
    89 posts
    Member since:
    Sep 2008

    Posted 08 Dec 2008 Link to this post

    Do you believe I can use this link 
    http://www.telerik.com/community/forums/aspnet-ajax/grid/read-only-controls-for-editing.aspx ?

    My column is a GridBoundColumn
  7. Stavros
    Stavros avatar
    89 posts
    Member since:
    Sep 2008

    Posted 08 Dec 2008 Link to this post

    Ok I'll upload the code :

    aspx file : http://www.shorttext.com/8nav6s

    code behind file : http://www.shorttext.com/6jtkat0

    data sources : http://www.shorttext.com/nuyw5gq
  8. Stavros
    Stavros avatar
    89 posts
    Member since:
    Sep 2008

    Posted 09 Dec 2008 Link to this post

    No ideas guys?
    Should I use a support ticket?
  9. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 11 Dec 2008 Link to this post

    Hi Stavros,

    We tested the issue that you described this far, with the latest build to the Telerik controls, and failed to replicate the issue. I have attached the code sample that I used for testing to the support ticket that you have opened on the matter. To avoid duplicate posts, we can continue our communication there.

    Kind regards,
    Georgi Krustev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Stavros
    Stavros avatar
    89 posts
    Member since:
    Sep 2008

    Posted 11 Dec 2008 Link to this post

    Thank you very much Georgi.
    I would be very glad if you could help me with my other question below because I can't make update work.
  11. JD.
    JD. avatar
    37 posts
    Member since:
    Aug 2012

    Posted 06 Aug 2012 Link to this post


    Is 'ForceExtractValue'  No longer a valid property?   is it deprecated ?  what alternative ? 

    Regards
  12. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Aug 2012 Link to this post

    Hi,

    The ForceExtractValue property is available in the version 2012, 2, 607, 40 which can be used when inserting or updating records.
    aspx:
    <telerik:GridBoundColumn ForceExtractValue="InEditMode" DataField="name" UniqueName="name" HeaderText="name">
    </telerik:GridBoundColumn>

    Thanks,
    Shinu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017