This is a migrated thread and some comments may be shown as answers.
GridAttachmentColumn does not insert
4 Answers 41 Views
This is a migrated thread and some comments may be shown as answers.
tony
Top achievements
Rank 1
tony asked on 24 May 2012, 01:48 AM
i have a radgrid with a gridattachmentcolumn column. the grid is bound to an entitydatasource having the 3 columns stipulated in the documentation - FileName, DataText, and Attachment, the last being a varbinary(max) column.
<telerik:GridAttachmentColumn AttachmentDataField="Attachment"
    AttachmentKeyFields="ItemID,ForeignKeyID,AttachmentID"
    DataSourceID="ItemAttachmentEntityDataSource" DataTextField="DataText"
    FileName="attachment" FileNameTextField="FileName"
    FilterControlAltText="Filter column column" HeaderText="Attachment"
    UniqueName="Attachment">
</telerik:GridAttachmentColumn>

when i click add new record, fill in the three columns, the text columns are inserted but not the attachment. i thought that the insert would be handled by the grid, yet all of the examples for gridattachmentcolumn i have seen include a prodigious amount of code to handle the insert. do i need to manually insert the data myself? if so, what is the point of the column type? which event would be the best one to write the code? i am handling the insertcommand so would hope there are no objections to doing it there.

if indeed i am required to manually insert the data, please update your documentation to stress this point. if radgrid can declaratively handle my scenario, are there any reasons why my insert is failing?


4 Answers, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 28 May 2012, 01:17 PM
Hi,

Yes, the GridAttachmentColumn could not perform automatic CRUD operations even though they are allowed on the datasource. As described in the description of this online demo application this is due the fact that the GridAttachmentColumnEditor could not extract the binary data automatically and thus the ExtractValuesFromItem method could not be used for this column type.


could no
Kind regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
tony
Top achievements
Rank 1
answered on 28 May 2012, 07:48 PM
that is interesting....the gridbinaryimagecolumn works automatically so i was expecting this control to follow suit. perhaps an enhancement could be made to do so.

could i use gridbinaryimagecolumn to upload word, pdf, and other non-image data? i am thinking yes, but am too busy to find the answer experimentally :-o...thanks
0
Bill
Top achievements
Rank 1
answered on 22 Aug 2012, 02:01 AM
I agree the File Attachment column is too convoluted and confusing, I wish there was an easier demo to follow or something that allowed CRUD to work better.  I have noticed other having difficulty with the online demo from other posts.
0
Andrey
Telerik team
answered on 27 Aug 2012, 06:39 AM
Hello,

Thank you for your suggestions. It is always greatly appreciated to get some first-hand feedback. I will redirect your suggestion to our Dev team for consideration, and we will do what we can to improve this experience.

Regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
tony
Top achievements
Rank 1
Answers by
Andrey
Telerik team
tony
Top achievements
Rank 1
Bill
Top achievements
Rank 1
Share this question
or