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

[Solved] Why isn’t the image name or image displayed when the grid is in editMode?

2 Answers 156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris Yoker
Top achievements
Rank 1
Chris Yoker asked on 02 Nov 2009, 11:47 AM

vs2008

q2 2009


hiya,

 

I’m using the binaryImage column in the samples:

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx?product=grid


When the user edits a row, the “image name”, and “description” are correctly assigned.

 

However, the “Image” GridBinaryImageColumn contains nothing…This is counter intuitive.

How can I assign the current value to this GridBinaryImageColumn, so that the user can save the record without having to manually browse for the image?

 

Many thanks,

 

yogi

2 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 05 Nov 2009, 11:16 AM
Hi Chris,

The behavior you are experiencing is expected as the grid is storing into the database the binary data of the image - not its path. Hence, when you open the edit form there is no way for the grid control to automatically populate the upload text box with the path to the image all the more as this path might have changed meanwhile. On the other hand, it is not reasonable for the grid to cache the old binary data so that if you do not choose a file to upload it will send the old binary to the data store. The reasonable and logical way to implement your scenario is to check if the user has selected a file to upload or not and change the update command of the data source control accordingly. The attached sample demonstrates an easy way to achieve that

I hope this helps.

Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Chris Yoker
Top achievements
Rank 1
answered on 09 Nov 2009, 02:23 PM
Hi,

Yes this helped me.Thanks.Though there was no database included with it though, so I had to add my own.

Chris
Tags
Grid
Asked by
Chris Yoker
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Chris Yoker
Top achievements
Rank 1
Share this question
or