Telerik Forums
UI for ASP.NET AJAX Forum
12 answers
921 views
Hi,

I have an issue in the asyncupload. I am uploading a file and checking the file name through database that it is existing or not and i am doing this through the javascript pagemethod. But through the pagemethod i just want to remove the file on a particular condition.
Like 

function ToResetValidation(sender, eventArgs) {
            var FileName = eventArgs.get_fileName().split('.').reverse().slice(1).reverse().join('.');
            PageMethods.GetFileName(FileName, Onsucess);
                  }


 function Onsucess(result) {
            if (result == 1) {
                alert('This file is already exsist');
*********              // Here i have to remove the file from uploader on clientside  *******   CONDITION
                return false;
            }
        }


<telerik:RadAsyncUpload ID="RUImage"  OnClientDeleting="ToDeleteFile" runat="server"
                                            AllowedFileExtensions=".pdf,.doc,.docx" ControlObjectsVisibility="None" InputSize="35" Width="300px" style="float:left; margin-top:5px; "
                                            Font-Names="Arial" MaxFileSize="5242880" OnClientFileUploaded="ToResetValidation"
                                            AutoAddFileInputs="true" OnClientValidationFailed="validationFailed" MaxFileInputsCount="1"
                                            TabIndex="4" >
                                        </telerik:RadAsyncUpload>


Thanks
Manish
Plamen
Telerik team
 answered on 24 Dec 2015
1 answer
164 views

Hello All,

Please I am using telerik 2013 Q13. I make use of the barcode which is printed on a sales receipt.

The issue here is that the barcode on the receipt cant be scanned using a barcode scanner.

What might i be doing wrong. Any help or advice.

Thanks

Konstantin Dikov
Telerik team
 answered on 24 Dec 2015
1 answer
99 views

The user clicks a button and in the code-behind there is a very long process in which I am adding an Item to the ListBox to update the user of what step the process is currently in. By the time the process is done there are 40 new Items but they are only displayed when the process is done. I want the the Item to be displayed immediately for the user in an Ajax kind of way.

I added the RadAjaxLoadingPanel and RadAjaxPanel to my page but still the Items were displayed after the completion of the long process instead of immediately.

 Any guidance on this would be appreciated!

Ivan Danchev
Telerik team
 answered on 23 Dec 2015
1 answer
155 views

Hello guys i need your help

I have two sqlDatasources : 

<asp:SqlDataSource ID="sqlLookupDepartments" runat="server" ConnectionString="<%$ ConnectionStrings:WEBCMSConnectionString %>" SelectCommand="SELECT top 5 * FROM [tblLookupDepartments]"></asp:SqlDataSource>

<asp:SqlDataSource ID="sqlDepartments" runat="server" ConnectionString="<%$ ConnectionStrings:WEBCMSConnectionString %>"></asp:SqlDataSource>

 

First one has assigned the SelectCommand, the second will be assigned programmatically onPageLoad event :

 

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            var sqlQuery = "SELECT top 5 * FROM [tblLookupDepartments]";
            sqlDepartments.SelectCommand = sqlQuery;
            sqlDepartments.DataBind();
            RadGrid2.Rebind();  
        }

    }

 

Then i added funcionallity to export to excel to Radgrid 1 using the first sqlDatasource, this is working without any problems

 

        <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="-1" Culture="es-ES" DataSourceID="sqlLookupDepartments" GridLines="Both" GroupPanelPosition="Top">
            <ExportSettings IgnorePaging="true" Excel-Format="ExcelML" ExportOnlyData="true" OpenInNewWindow="true"></ExportSettings> 
            <MasterTableView AutoGenerateColumns="true" DataKeyNames="department_id" DataSourceID="sqlLookupDepartments" CommandItemDisplay="Top">
             <CommandItemSettings ShowExportToExcelButton="True" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                <Columns>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

 

But when im tryng to do the same on Radgrid2 using the second sqlDatasource

 

        <telerik:RadGrid ID="RadGrid2" runat="server" CellSpacing="-1" Culture="es-ES" DataSourceID="sqlDepartments" GridLines="Both" GroupPanelPosition="Top" OnItemCommand="RadGrid2_ItemCommand">
            <ExportSettings IgnorePaging="true" Excel-Format="ExcelML" ExportOnlyData="true" OpenInNewWindow="true"></ExportSettings> 
            <MasterTableView AutoGenerateColumns="true" DataKeyNames="department_id" DataSourceID="sqlDepartments" CommandItemDisplay="Top">
             <CommandItemSettings ShowExportToExcelButton="True" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                <Columns>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

 

This radgrid2 have a ttached the OnItemCommand event 

 

    protected void RadGrid2_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        RadGrid2.ExportSettings.Excel.Format = GridExcelExportFormat.Biff;
        RadGrid2.ExportSettings.IgnorePaging = true;
        RadGrid2.ExportSettings.ExportOnlyData = true;
        RadGrid2.ExportSettings.OpenInNewWindow = true;
        RadGrid2.MasterTableView.ExportToExcel();
    }

 

After clickind on teh export to Excel button, it downloads the excel file , but its empty.

 

Please i will appreciate your help regarding this issue.

 

Thank you very much.

 

Regards,

Alberto

 

Eyup
Telerik team
 answered on 23 Dec 2015
1 answer
104 views

I have a Radgrid with batch edit mode. I a drop down list "On_maintenance" and a datepicker "Maintenance_EXP_DT", I wanted to add validation to the datepicker only if the drop down list value is "Yes".

 Example:

If drop down list value is "yes" then datepicker is mandatory, else datepicker is optional.

 Below is my code:

<telerik:GridTemplateColumn FilterDelay="1000" ShowFilterIcon="true" DataField="On_Maintenance" HeaderText="On Maintenance" UniqueName="On_Maintenance" ItemStyle-Width="100px" HeaderStyle-Width="100px" SortExpression="On_Maintenance">
                                        <FilterTemplate>
                                            <telerik:RadComboBox ID="cmbOn_Maintenance"  DataTextField="On_Maintenance" Width="80px"
                                                DataValueField="On_Maintenance" maxHeight="200px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("On_Maintenance").CurrentFilterValue %>'
                                                runat="server" OnClientSelectedIndexChanged="On_MaintenanceChanged">
                                                <Items>
                                                    <telerik:RadComboBoxItem Text="" />
                                                    <telerik:RadComboBoxItem Text="No" Value="No" />
                                                    <telerik:RadComboBoxItem Text="Yes" Value="Yes" />
                                                </Items>
                                            </telerik:RadComboBox>
                                            <telerik:RadScriptBlock ID="sbOn_Maintenance" runat="server">
                                                <script type="text/javascript">
                                                    function On_MaintenanceChanged(sender, args) {
                                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                        tableView.filter("On_Maintenance", args.get_item().get_value(), "EqualTo");
                                                    }
                                                </script>
                                            </telerik:RadScriptBlock>
                                        </FilterTemplate>
                                        <ItemTemplate>
                                            <%# Eval("On_Maintenance") %>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <telerik:RadDropDownList runat="server" ID="ddlOn_Maintenance" DataTextField="On_Maintenance" DataValueField="On_Maintenance" Width="80px">
                                            <Items>
                                                    <telerik:DropDownListItem Text="No" Value="0"/>   
                                                    <telerik:DropDownListItem Text="Yes" Value="1"/>
                                            </Items>
                                            </telerik:RadDropDownList>
                                        </EditItemTemplate>
                                    </telerik:GridTemplateColumn>

<telerik:GridTemplateColumn FilterDelay="1000" ShowFilterIcon="true" HeaderText="Maintenance Exp Date" DataField="Maintenance_Exp_DT" UniqueName="Maintenance_Exp_DT" ItemStyle-Width="200px" HeaderStyle-Width="200px" SortExpression="Maintenance_Exp_DT">
                                        <FilterTemplate>
                                            <telerik:RadDatePicker id="dpMaintenance_Exp_DT" runat="server"  
                                               ClientEvents-OnDateSelected="Maintenance_Exp_DTChanged">
                                                <DateInput runat="server" DateFormat="yyyy-MM-dd"></DateInput> 
                                            </telerik:RadDatePicker>
                                            <telerik:RadScriptBlock ID="sbMaintenance_Exp_DT" runat="server">
                                                <script type="text/javascript">
                                                    function Maintenance_Exp_DTChanged(sender, args) {
                                                        
                                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                        var DatePicker = $find('<%# ((GridItem)Container).FindControl("dpMaintenance_Exp_DT").ClientID %>');
                                                        //var date = FormatSelectedDate(sender.toString());
                                                        
                                                        var Date = FormatSelectedDate(DatePicker);
                                                        //alert(Date);
                                                        tableView.filter("Maintenance_Exp_DT", Date , "EqualTo");
                                                    }

                                                    function FormatSelectedDate(picker) {
                                                        var date = picker.get_selectedDate();
                                                        var dateInput = picker.get_dateInput();
                                                        var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat());
                                                        return formattedDate;
                                                    }
                                                </script>
                                            </telerik:RadScriptBlock>
                                        </FilterTemplate>
                                        <ItemTemplate>
                                            <%# Eval("Maintenance_Exp_DT") %>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                           <telerik:RadDatePicker id="dpMaintenance_Exp_DT1" runat="server"  >
                                                <DateInput runat="server" DateFormat="yyyy-MM-dd"></DateInput> 
                                            </telerik:RadDatePicker>
                                            <%--<asp:RequiredFieldValidator ID="rfvMaintenance_Exp_DT1" ForeColor="Red" runat="server" ErrorMessage="This field is mandatory" ControlToValidate="dpMaintenance_Exp_DT1"></asp:RequiredFieldValidator>--%>
                                        </EditItemTemplate>
                                    </telerik:GridTemplateColumn>

Konstantin Dikov
Telerik team
 answered on 23 Dec 2015
2 answers
103 views
We are facing issue while closing the telerik rad window. In telerik rad window, we are doing updates and clicks on ‘Save’ button. At the same time clicks on window’s tab and drag the window. After sometime the rad window will pop-up but we are unable to close the window by clicking on ‘Cancel’ link or ‘Close’ icon.
On click of ‘Cancel’ button application is calling “CloseAndRebind” function to close the window. Code is written as mentioned below
function CloseAndRebind() {
                        GetRadWindow().Close();
                        GetRadWindow().BrowserWindow.RefreshBarcodeSettingRadGrid();
                    }
                    function GetRadWindow() {
                        var oWindow = null;
                        if (window.radWindow)
                            oWindow = window.radWindow; 
                        else if (window.frameElement.radWindow)
                            oWindow = window.frameElement.radWindow; 
                        return oWindow;
                    }
Same behavior we have observed in one of the demo of telerik rad window. 
URL of Telerik  rad window demo: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window
Steps to reproduce issue in demo URL
1. Click “Add New Record” link
2. Click on “Insert” button
3. At the same time drag the popup
4. New record will be inserted but pop-up will not closed, now click on “Cancel” button
Pop-up should be closed but it isn’t. We are facing the same issue.
Please do needful.
Rahul
Top achievements
Rank 1
 answered on 23 Dec 2015
2 answers
100 views
I have the following code. When I expand the HydroTest panel bar it invokes the function HydroTestRadPanelBar_ItemExpand() , which collapses other panel bars which reside in other user controls (ASCX). This works, but after this, if I try to expand the collapsed panel bars using the UI, they will not expand. What am I missing?
<script type="text/javascript" id="telerikClientEvents1">
//<![CDATA[
 
    function HydroTestRadPanelBar_ItemExpand(sender,args)
    {
        var panelbar = $find(weld1UserControlWeldRadPanelBarClientID);
 
        for (var i = 0; i < panelbar.get_allItems().length; i++) {
            panelbar.get_allItems()[i].set_expanded(false);
        }
 
        var panelbar2 = $find(weld2UserControlWeldRadPanelBarClientID);
 
        for (var i = 0; i < panelbar2.get_allItems().length; i++) {
            panelbar2.get_allItems()[i].set_expanded(false);
        }
 
        var panelbar3 = $find(jointUserControlJointRadPanelBarClientID);
 
        for (var i = 0; i < panelbar3.get_allItems().length; i++) {
            panelbar3.get_allItems()[i].set_expanded(false);
        }
    }
 
//]]>
</script>
Ivan Danchev
Telerik team
 answered on 23 Dec 2015
2 answers
72 views
Hello,

I have recently upgraded from using CuteEditor to RadEditor but am having an issue with the FileExplorer functionality.

There is one site (IIS 7.0) containing the Editor used for admin purposes, this points to a virtual directory to save images in the /uploads folder of the main site (also IIS 7.0).

Images can be saved, renamed and deleted perfectly however when they are saved none of them have the standard IUSR user and permissions (even though it is on the parent folder) resulting in a 401 error every time the main site tries to view the uploaded image.

Why are the files not being saved with the parent folders permissions and how can I set it to that it saves them in a way that is viewable by the main site?
Sam
Top achievements
Rank 1
 answered on 23 Dec 2015
2 answers
86 views
Why OnClientDropDownPopulated does not implemented?  I want to process dataitems after data received from .asmx
I send additional data from server in data items attibutes and want to display it in other control. But I do not find the way to do that.
Nencho
Telerik team
 answered on 23 Dec 2015
1 answer
80 views
Hi! It's possible customize the steps in the wizard for view in circles instead of buttons something like that http://www.jqueryscript.net/demo/Simple-Wizard-Modal-Plugin-with-jQuery-Bootstrap-Easy-Wizard/
Nencho
Telerik team
 answered on 23 Dec 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?