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

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

10 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stavros
Top achievements
Rank 1
Stavros asked on 08 Dec 2008, 11:44 AM
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!

10 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Dec 2008, 11:56 AM
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
0
Stavros
Top achievements
Rank 1
answered on 08 Dec 2008, 12:24 PM
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. 

 

0
Stavros
Top achievements
Rank 1
answered on 08 Dec 2008, 12:28 PM
0
Stavros
Top achievements
Rank 1
answered on 08 Dec 2008, 12:36 PM
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
0
Stavros
Top achievements
Rank 1
answered on 08 Dec 2008, 01:23 PM
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
0
Stavros
Top achievements
Rank 1
answered on 09 Dec 2008, 09:31 AM
No ideas guys?
Should I use a support ticket?
0
Georgi Krustev
Telerik team
answered on 11 Dec 2008, 09:47 AM
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.
0
Stavros
Top achievements
Rank 1
answered on 11 Dec 2008, 10:10 AM
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.
0
JD.
Top achievements
Rank 1
answered on 06 Aug 2012, 03:15 PM

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

Regards
0
Shinu
Top achievements
Rank 2
answered on 07 Aug 2012, 04:23 AM
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.
Tags
Grid
Asked by
Stavros
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Stavros
Top achievements
Rank 1
Georgi Krustev
Telerik team
JD.
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or