hello
i am trying to insert an image in grid and selecting a row to edit i would want to update the image and be able to change it
Let me know If I may be of further assistance on this matter.
Hello Antonio,
Thank you for the provided clarifications!
I have created a sample for you in order to show you how to achieve your requirements. Basically you will need to use WebUpload control and on simple input button click I use the uploading functionality of the upload to get the path of the image and update it. I have two hidden fields which I use to store "filePath" and "rowId" which will be used in the update statement.
On button click (text of the button click will be different for each row, based on the value of ImageForDir field) I pass the rowId and simulate WebUpload button click, which will trigger a postback to the server when the file is uploaded. This is because server side events of the WebUpload do not allow to make any changes, they are used only to get data.
So on the postback I execute Update statement which will update the database with the new image path.
You can find db script attached also, the script is configure in a way that will create not only the data base schema, but will fill it with data also.
Code snippet:
Note:
Before you run the script change the first line to be not USE [ImageDB], but to be CREATE [ImageDB]. Or you can just create a empty database with ImageDB name and execute the script.
Looking forward to hearing from you.
the image url would be inserted at first programatically and when the user is viewing the grid he might want to edit it so he double clicks on a row and when he does so, he would get a button in the end of the row that would allow him to change the image. this button should be like the upload file,
thank you
Hi Antonio,
Will the inserting of the image be done programmatically or will this be a user defined? How do you wish to insert the image? For example is it the intent that the user will supply a value for the imageURL? The inserting of an image and updating the grid accordingly can be done.
If you can offer an overview with a little more detail as to what you are aiming to do, and how you want to do it, it will help with the recommended approach.
Thanks!