Hey there. (i posted this earlier in another thread, but nobody answers because the thread is already marked as solved)
I've managed to load images in my WebDataGrid (Infragstics4.Web.v15.2) with your method and bit from a IG example site.
The designer tells me, i added the the right way to the TemplateDataField.
But when i debug the project (in IE or in Chrome) i get nothing...
Here is my Code:
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="100%" Width="100%"><Columns><ig:TemplateDataField Key="Image" VisibleIndex="0"><Header Text="Bild"></Header><ItemTemplate>
<%-- static image for testing --%><img style="height: 70px;width: 50px" src="C:\Users\f.schaetzler\Pictures\Folders-OS-Pictures-Library-Metro-icon.png"/><%-- getMAImage returns the imagepath--%><img style="height:70px;width: 50px" src="<%# getMAImage(DataBinder.Eval(Container, "DataItem.adusername"))%>"/></ItemTemplate></ig:TemplateDataField></Columns><ClientEvents Initialize="intializeGrid" /><Behaviors><ig:Activation Enabled="true" /><ig:Sorting Enabled="true" SortingMode="Single"> </ig:Sorting><ig:Selection Enabled="true" RowSelectType="Single" CellClickAction="Row" ColumnSelectType="Single" /></Behaviors></ig:WebDataGrid><ig:WebScriptManager ID="WebScriptManager1" runat="server"></ig:WebScriptManager>
The rest of the colums are auto generated from the databinding loaded from the code behind.
Thank you for any help! And have a nice weekend.
Hello,
Thank you for contacting Infragistics!
I have created a sample to test this behavior and I have been unable to reproduce the behavior you describe. I am attaching my sample using v15.2.20152.2125 of our ASP.NET controls. Can you run it and let me know what you see? What is the service release you are using for v15.2? Do you have an isolated sample that reproduce the issue?
Looking at your code I would like to note a couple things. First it is generally better to have the script manager above any controls that are going to use it. Next is you don’t want to reference images from you C drive. You would instead want in it your folder of your project/application. As you cannot guarantee your users would have the file locally on their C drive so you would want to deploy it with your website.
Good monday!
Thank you for your constructive reply. I'm writing this post the third time, because your attachment upload crashes all the time when the upload finishes... it may come from the file size (20mb). Using chrome on MacBook for posting this.
Even with your code advise, i was not able to trace the Error. I attached an isolated project, where the error occurs.
Download link for my project: http://s000.tinyupload.com/?file_id=34403847015181967594
Thank you for the update. In looking at your sample there a couple reasons why you are unable to see the image. The first is that you are trying to reference it through the system file path/system which the browser does not have access to due to security reasons. The next is that you have the image in the bin folder which it also does not have access to for. If you want your images in a folder separate from your code I recommend creating an images folder. I have modified your sample to demonstrate how you can achieve the behavior of showing an image.
Note for uploading files in the future I believe we have a 10MB limit on file size which is why you were failing to upload. To get under this limit you can delete the packages folder and the bin folder. As the packages folder will rebuild/populate when running the project and for the bin folder I have access to the Infragistics dlls so I can replace them myself.
Hey.
Thank you for your patience. i completely forgot, that i can write relative paths...