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

foreign key value and BinaryImage in Grid

1 Answer 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 07 Jul 2009, 06:37 PM
I have a RadGrid that I am using for website users to upload photos and related information.I am using Asp.Net membership services to identify users, and have the database configured to use the UserID (a GUID value) as the foreign key so that uploaded photos are tied to the user who uploaded them.

The grid is working without the foreign key, images being uploaded and displaying, but I have two issues/questions.

(1) When the user edits an image, if the image (or another image) is not selected in the GridBinaryImageColumn then the existing image is deleted (or overwritten with null). What I'd like to have happen is that if no image is selected, I'd like to leave the existing image there.

(2) On insert, I'd like to have the UserID saved to the appropriate column in the SQL table, but I don't want to display it. Once the user is logged in then the UserID is stored in a session variable, but what I want to do is save the UserID value to the appropriate column on an insert. I don't need to worry about it on an update.

Thanks in advance for any insight.

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 10 Jul 2009, 10:50 AM
Hello Derek,

Thank you for contacting us.

1) Unfortunately the required functionality is not possible with the built-in functionality. If you need to avoid deleting of the image when you update the item, you will need to avoid updating of the concrete field. You will not accomplish this task if you are using automatic operations.

2) To achieve your goal you will need to handle this functionality all by yourself. You can review this online demo which does not use automatic operations.

Kind regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Derek
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or