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

Attachment Column - what good is it?

1 Answer 220 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Heath Brown
Top achievements
Rank 1
Heath Brown asked on 11 Jun 2010, 03:25 AM
I've gone over the example of using the attachment column with Radgrid over and over.  I still can't get it to work.  What I don't understand, is that aren't these controls supposed to save time?  This control doesn't even save the information to the database like the gridbinaryimage column does.  Those of us trying to build customized CMS controls have to spend a great deal of extra time to try to get it working with a database.

I know the whole update thing in a grid isn't so great.  Is it better just to have a details page with a file upload control instead?  How does that work if you want to upload the content to a varbinary column?

EDIT:  I removed the end-of-a-bad day stuff.  Sorry about that.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 14 Jun 2010, 09:22 AM
Hi Heath,

The GridBinaryImageColumn expects to have a separate data source control for RadGrid and for the attachment column. We have tried to make it as flexible as possible, supporting declarative data source controls for downloading and uploading files in databases.  However, the attachment column cannot save the uploaded file into the database automatically, due to dependency of the inserted binary attachment record to a record from RadGrid's data source. Therefore, you need to insert/update the dependent record from RadGrid's data source before inserting a matching record from the attachment column's data source.

Apart from that, you need to watch AJAX issues.  When uploading and downloading filed, AJAX should be disabled for the duration of the upload/download, as files cannot be transfered asynchronously over  the XmlHttpRequest object.

Still, if you believe the GridAttachmentColumn is not suitable for your application scenario and you need greater flexibility setting up your binary attachment CRUD operations, I believe you can use a GridTemplateColumn with a donwload button in the ItemTemplate and a RadUpload in the EditItemTemplate equally well.

Greetings,
Veli
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Heath Brown
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or