Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
300 views

I'm using the RadAsyncUpload to upload files to a custom handler which stores the files into our database.  The custom handler returns a key value for the file which I want to then use during form postback to attach those uploads to the current record (which may be a brand-new record).  I can see the custom returned data on the client in OnClientFileUploaded() by using args.get_fileInfo().  From that standpoint I have everything working, upload, saving, validation, returning the file key.

Here's my definition of RadAsyncUpload:

                           <telerik:RadAsyncUpload RenderMode="Lightweight"

                                ID="AttachmentAsyncUploader"
                                runat="server"
                                CssClass="async-attachment"
                                MultipleFileSelection="Automatic"
                                UploadedFilesRendering="BelowFileInput"
                                OnClientFileSelected="OnClientFileSelected"
                                OnClientFileUploading="OnClientFileUploading"
                                OnClientValidationFailed="OnClientValidationFailed"
                                OnClientFileUploaded="OnClientFileUploaded"
                                OnClientFileUploadRemoved="OnClientFileUploadRemoved"
                                MaxFileSize="26214400"
                                DropZones="#DropZone"
                                HttpHandlerUrl="~/FileUploader.ashx"
                                HideFileInput="true">
                                <Localization Select="Select Files for Upload" />
                            </telerik:RadAsyncUpload>

Now the user posts the form back, so I call AttachmentAsyncUploader.UploadedFiles() which gives me a list of the files that were uploaded, but I can see no way to access the custom fileInfo fields that were returned by the handler.  Obviously just the file name isn't enough to figure out which attachments need to be attached to the newly created records.

Here is how I'm building and returning the meta-data from the custom handler, FileUploader.ashx (most importantly AttachedFileGuid):

            var result = CreateDefaultUploadResult<FileUploaderResult>(file);

             result.AttachedFileGuid = InsertFile(file);

             return result;

What is the expected way to get the full information about the uploaded files back to the postback?  Obviously, I can build my own field to store all that, but it seems an awful hack to use RadAsyncUpload and then just ignore it completely on postback.

Thanks in advance,

Vessy
Telerik team
 answered on 14 Nov 2017
1 answer
161 views

Hi,

I'm trying to figure out a way or if it is possible to get the other values from the selected record. For example,

If i have a query setup with multiple table joins as follows:

Select table1.person_id,

table1.name,

table1.age,

table1.gender,

table2.address_id, 

table2.address_1, 

table2.address_2,

table2.address_3,

table3.something1,

table3.something2

such that it could return multiple addresses for a single person

I would have the AutoCompleteBox DataTextField set to 'name', and the DataValueField set to 'person_id'.

How would i pull the address_id value out of the selected record, or really any of the other values?

I'm able to access these within the DropDownItemTemplate using DataBinder.Eval(Container.Dataitem, "address_id") to format what the user sees, but once they click the record i cannot save away the extra information that may or may not be displayed in the template. Since the person_id can have multiple address_id's associated to it, i cannot pull that value from the field and run a separate query since I'm not able to define which address was specifically chosen.

 

Peter Milchev
Telerik team
 answered on 14 Nov 2017
2 answers
326 views

Temp files are not getting cleared from App_Data folder. Below is the .aspx code

<telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" HideFileInput="true" MultipleFileSelection="Automatic"
                                            AllowedFileExtensions=".tif,.tiff,.pdf" OnClientFileSelected="onFileSelected"
                                            OnClientFileUploadRemoved="onFileSelected" TemporaryFileExpiration="05:00:00">

Below is the C# code for reading the image bytes.

foreach (UploadedFile file in AsyncUpload1.UploadedFiles)
{

 using (MemoryStream ms = new MemoryStream())
    {
                file.InputStream.CopyTo(ms);

    }

}

Jason
Top achievements
Rank 1
 answered on 14 Nov 2017
0 answers
102 views

I have hidden the input field so that only the select button is displayed:

HideFileInput="True"

I want the select button to appear alongside other radButton controls so it does not look out of place.

I guess I have to do some css to override 'ruSelectWrap'?

If this means also hiding the selected file list, that is fine.

But would like 'Upload' inline with the other rad buttons?

Thanks

 

 

Jason
Top achievements
Rank 1
 asked on 14 Nov 2017
0 answers
154 views

Hi I have a datepicker control on my webpage, but it will not open unless I do a post back of some sort. For example sorting a column on the page's RadGrid. Once the postback happens it works as expected. I tried added the on open client event, confirming that nothing happens when you click the text box or button to open the calendar. There is nothing on the server side code behind that affects the control either. I'm completely stumped, any help is appreciated. This is what my control looks like:

<telerik:RadDatePicker runat="server" ID="calFromDate" Skin="MetroTouch" Width="100px" Height="29px" BorderColor="#ccc"
    ShowPopupOnFocus="true" DatePopupButton-Visible="true">
    <Calendar ID="Calendar1" runat="server" EnableKeyboardNavigation="true" ShowRowHeaders="False">
    </Calendar>
Randell
Top achievements
Rank 1
 asked on 13 Nov 2017
12 answers
367 views
Hi,

I've a problem when try to exporting my radgrid with excel button.
When exporting the data, page loses the pager.

Data was exported successfully.

How can i resolve this problem?

Thanks
Regards
Omar
Top achievements
Rank 1
 answered on 13 Nov 2017
0 answers
115 views

Just starting with RadGrid..

Have grid with a TemplateField, which has an ImageButton.  When clicked it will show a form below the grid (not associated with grid data) with 2 textboxes and a button.  When the button is clicked, it needs to get the values associated with the row that was clicked (only 1 row can be selected) server side .  How can I get the values of specific cells in that row, server side?  I have added the DataKeyNames on the MasterTableView.  If I get the DataKeyNames is there a way to use that to get the values of the cells I want?

Trying to recreate functionality in Intersoft Solutions webUI Grid as we move to Telerix.

 

thanks

John
Top achievements
Rank 1
 asked on 13 Nov 2017
4 answers
211 views

Hi,

 

I've radGrid in which I display couple of date columns. I format the date using DataFormatString property. It displays good in grid as I want. But when downloaded to excel the values don't make any sense to me. 

<CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
 
<telerik:GridBoundColumn DataField="LiquidationDate" UniqueName="LiquidationDate" HeaderText="Liquidation Date" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />

 

Attached images to show how they are displayed in grid vs excel. Please help. 

Attila Antal
Telerik team
 answered on 13 Nov 2017
4 answers
205 views
hi,
i am having grid(placed) in  RADAJAXPANEL and i want export to all but when i click to any button for exporting nothing will happen
How can i do this?
my Grid is
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
                           <%-- EnableViewState="False" --%>
                           <telerik:RadGrid ID="RadGrid1" runat="server" Width="530px" OnNeedDataSource="RadGrid1_NeedDataSource"
                               AllowPaging="true" PageSize="10" AllowSorting="true" ShowGroupPanel="True" Skin="Default"
                               OnDeleteCommand="RadGrid1_DeleteCommand" HeaderStyle-Font-Bold="true" OnPreRender="RadGrid1_PreRender"
                               OnUpdateCommand="RadGrid1_UpdateCommand" OnItemCreated="RadGrid1_ItemCreated"
                               OnInsertCommand="RadGrid1_InsertCommand">
                               <ExportSettings ExportOnlyData="true" OpenInNewWindow="true" IgnorePaging="true">
                                   <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm"
                                       BorderStyle="Medium" BorderColor="#666666">
                                   </Pdf>
                                   <Csv />
                                   <Excel />
                               </ExportSettings>
                               <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle>
                               <ClientSettings Selecting-AllowRowSelect="true" AllowDragToGroup="True" EnablePostBackOnRowClick="true">
                                   <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True"></Selecting>
                               </ClientSettings>
                               <MasterTableView EditMode="EditForms" AutoGenerateColumns="true" DataKeyNames="CompId"
                                   CommandItemDisplay="Top" CommandItemSettings-ShowAddNewRecordButton="true">
                                   <CommandItemSettings ShowExportToPdfButton="true" />
                                   <CommandItemSettings ShowExportToCsvButton="true" />
                                   <CommandItemSettings ShowExportToExcelButton="true" />
                                   <CommandItemSettings ShowExportToWordButton="true" />
                                   <EditFormSettings FormMainTableStyle-HorizontalAlign="Center" EditColumn-ButtonType="ImageButton"
                                       FormTableStyle-Width="300px" FormTableButtonRowStyle-HorizontalAlign="Center"
                                       FormTableStyle-CellPadding="3" FormMainTableStyle-Font-Bold="true" FormMainTableStyle-ForeColor="Purple"
                                       FormStyle-CssClass="" FormTableStyle-CellSpacing="5" InsertCaption="Add New Record"
                                       FormCaptionStyle-Font-Bold="true" FormCaptionStyle-Font-Underline="true" FormCaptionStyle-ForeColor="Black"
                                       FormCaptionStyle-Font-Size="Large" FormCaptionStyle-HorizontalAlign="Center"
                                       FormCaptionStyle-Width="100%">
                                       <FormStyle Width="100%" BackColor="LightCyan"></FormStyle>
                                   </EditFormSettings>
                                   <Columns>
                                       <telerik:GridEditCommandColumn ButtonType="ImageButton">
                                       </telerik:GridEditCommandColumn>
                                   </Columns>
                               </MasterTableView>
                               <MasterTableView>
                                   <Columns>
                                       <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"
                                           ButtonType="ImageButton" />
                                   </Columns>
                               </MasterTableView>
                           </telerik:RadGrid>
                       </telerik:RadAjaxPanel>

thanks
Omar
Top achievements
Rank 1
 answered on 12 Nov 2017
2 answers
493 views
Do you have a sample for which you can convert a label to text box and update it ?
Tess
Top achievements
Rank 1
 answered on 11 Nov 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?