I have been trying to use the new GridBinaryImageColumn to display data in an Oracle table. After a few days of trying different things, I finally have it doing the inserts. I pretty much have to do the inserts manually as no matter how I tried I couldn't get the declaritve methods to work. My problem now is displaying the image in the grid column, the data is in the table, but the grid just displays it as a broken image, I guess it doesn't like the way Oracle returns the binary data (I have it stored in a BLOB column). I guess I need to know what I need to do, to get it to display the image correctly.
Here is the relevant part of the .aspx page:
The select method returns a DataSet from an Oracle procedure:
Here is the relevant part of the .aspx page:
< telerik:GridTableView DataKeyNames="imageID" DataSourceID="IssueScreenshotsDataSource" Width="100%"
|
||||||||||
| runat="server" CommandItemDisplay="Top" Name="Screenshots"> | ||||||||||
| <ParentTableRelation> | ||||||||||
| <telerik:GridRelationFields DetailKeyField="issueID" MasterKeyField="issueId" /> | ||||||||||
| </ParentTableRelation> | ||||||||||
| <CommandItemSettings AddNewRecordText="Add A Screenshot" /> | ||||||||||
| <Columns> | ||||||||||
| <telerik:GridTemplateColumn HeaderText="Image Name" UniqueName="filename"> | ||||||||||
| <ItemTemplate> | ||||||||||
| <asp:Label runat="server" ID="lblName" Text='<%# Eval("fileName") %>' /> | ||||||||||
| </ItemTemplate> | ||||||||||
| <EditItemTemplate> | ||||||||||
| <telerik:RadTextBox runat="server" Width="200px" ID="txbName" Text='<%# Bind("fileName") %>' /> | ||||||||||
| <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="txbName" | ||||||||||
| ErrorMessage="Please, enter a name!" Display="Dynamic" SetFocusOnError="true" /> | ||||||||||
| </EditItemTemplate> | ||||||||||
| <HeaderStyle Width="30%" /> | ||||||||||
| </telerik:GridTemplateColumn> | ||||||||||
| <telerik:GridBinaryImageColumn DataField="data" HeaderText="Screenshot" UniqueName="screenshot" | ||||||||||
| ImageAlign="NotSet" ImageHeight="60px" ImageWidth="60px" ResizeMode="Fit"> | ||||||||||
| </telerik:GridBinaryImageColumn> | ||||||||||
| <telerik:GridButtonColumn ConfirmText="Are you sure you wish to delete this Screenshot?" | ||||||||||
| ButtonType="imageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1"> | ||||||||||
| <ItemStyle HorizontalAlign="Center" /> | ||||||||||
| </telerik:GridButtonColumn> | ||||||||||
| </Columns> | ||||||||||
| </telerik:GridTableView> |
| PROCEDURE APPS_ISSUE_GET_SCRNSHOT_BY_FK ( |
| p_issue_id IN NUMBER, |
| cur_out OUT sys_refcursor |
| ) |
| IS |
| BEGIN |
| OPEN cur_out FOR |
| SELECT image_id imageID, issue_id issueID, file_data data, |
| file_name fileName |
| FROM apps_issue_screenshots |
| WHERE (issue_id = p_issue_id); |
| END; |