I am having some issues with a file upload within a radGrid Edit Template.
I have a table of data which consists of a number of varchar columns and one field for images. Images are not stored as binary, only a string reference to the file location.
I would like the user to be able to click the edit button and a template showing a file upload control. Which will allow the user to upload an image, then when the image is uploaded to update the textual path in the database row.
I can currently upload the file but the itemupdated event never fires and I am having issues gathering the row details in the grid (Part No, Part Revision).
Above is the code for the grid. I am currently handling the image (creating a thumb) in the upload 'OnValidatingFile' Event.
Essentially this project calls for a list of parts to be displayed in a grid or list and for the user to be able to update/delete images for this part.
I have spent quite a while looking at this issue and I cannot help think I am overthinking it.
As always your help is appreciated!
Cheers,
I have a table of data which consists of a number of varchar columns and one field for images. Images are not stored as binary, only a string reference to the file location.
I would like the user to be able to click the edit button and a template showing a file upload control. Which will allow the user to upload an image, then when the image is uploaded to update the textual path in the database row.
I can currently upload the file but the itemupdated event never fires and I am having issues gathering the row details in the grid (Part No, Part Revision).
| <telerik:RadProgressManager ID="RadProgressManager1" runat="server" /> |
| <telerik:RadProgressArea ID="RadProgressArea1" runat="server" /> |
| <telerik:RadGrid ID="RadGridImageUpload" runat="server" |
| DataSourceID="SqlDataSourceImagePart" GridLines="None" AllowPaging="True" AllowAutomaticUpdates="false" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" |
| AllowSorting="True" AutoGenerateEditColumn="True"> |
| <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSourceImagePart"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="PART_NO" HeaderText="PART_NO" |
| SortExpression="PART_NO" UniqueName="PART_NO"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="REV_NO" HeaderText="REV_NO" |
| SortExpression="REV_NO" UniqueName="REV_NO"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="STATE" HeaderText="STATE" |
| SortExpression="STATE" UniqueName="STATE"> |
| </telerik:GridBoundColumn> |
| <telerik:GridImageColumn UniqueName="ImagecolumnPart" HeaderText="Image" DataImageUrlFields="IMAGEPATH" |
| DataImageUrlFormatString="~/ApplicationImages/Thumbs/{0}" DataAlternateTextField="PART_NO" ></telerik:GridImageColumn> |
| </Columns> |
| <EditFormSettings EditFormType="Template"> |
| <FormTemplate> |
| <telerik:RadUpload ID="RadUpload1" runat="server" MaxFileInputsCount="1" |
| OnValidatingFile="RadUpload1_FileExists" TargetFolder="~/ApplicationImages/" |
| OverwriteExistingFiles="false"> |
| </telerik:RadUpload> |
| <br /> |
| <asp:Button ID="ButtonSubmit" runat="server" Text="Submit" onclick="ButtonSubmit_Click"/> |
| </FormTemplate> |
| </EditFormSettings> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <asp:SqlDataSource ID="SqlDataSourceImagePart" runat="server" |
| ConnectionString="<%$ ConnectionStrings:DIG_ConnectionString %>" |
| SelectCommand="SELECT * FROM [DIG_ENG_PART_REVISION] "> |
| </asp:SqlDataSource> |
Above is the code for the grid. I am currently handling the image (creating a thumb) in the upload 'OnValidatingFile' Event.
Essentially this project calls for a list of parts to be displayed in a grid or list and for the user to be able to update/delete images for this part.
I have spent quite a while looking at this issue and I cannot help think I am overthinking it.
As always your help is appreciated!
Cheers,