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

[Solved] How to manage attachments (binary database fields)

3 Answers 91 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael Hassinger
Top achievements
Rank 1
Michael Hassinger asked on 14 Oct 2010, 11:21 PM
What I'd like to accomplish is having a grid column for attachments, where on double clicking into a cell to edit, the user can browse for a file on their hard drive and upload it as an attachment for the row.  I have the binary column in my database, but I haven't found any examples on how to do this within the GridView control.

Is it possible?

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 15 Oct 2010, 12:10 PM
Hi Michael Hassinger,

You can use the this.RadGridView1.BeginningEdit event. Inside the event handler you may show the UI for browsing the files. At the end you may update the relevant property of the business object relevant to the row.
You may get a reference to the business object being edited via the data context of the cell /row.

Let me know if you find any troubles while implementing this. 
I  will be glad to assist you further.

Kind regards,
Pavel Pavlov
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
0
Michael Hassinger
Top achievements
Rank 1
answered on 25 Oct 2010, 11:20 PM
The requirements for this have changed.

Since the customer desires a one-to-many relationship between a row in the grid and the attachments, I need to approach it differently. I want to display a hyperlink in the row with the number of attachments as the text of the link, and when they click the link, open a childwindow which will know the ID of the record so I can look up and manage the attachments there.

What I'm currently having an issue doing is getting that hyperlink column set up correctly. Do you have any examples of that?  Clicking a link in a column to open a child window that knows information about the data in the row the link was in?

Thanks!
0
Pavel Pavlov
Telerik team
answered on 26 Oct 2010, 03:02 PM
Hello Michael Hassinger,

I have prepared a small sample for you . It demonstrates one of the possible implementations of the requested behavior.

Let me know in case you need additional help while adapting this approach to your production code.

*Please find the sample attached.

Greetings,
Pavel Pavlov
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
GridView
Asked by
Michael Hassinger
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Michael Hassinger
Top achievements
Rank 1
Share this question
or