Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
365 views

I use a Telerik control in my page, the RadAsyncUpload. Is really simple and clear to use, but I want also this: if the file size to upload is greater than 20KB, the page must show a message (using a RadConfirm): "can take a while. Are you sure?"
And here start the problems. When the file's size is <20KB is all okay, but in the other case.. I lost the file persistence! How can I fix it?
I show you my code

 

 

In the .aspx:

...
<script language="javascript" type="text/javascript">
    function confirmCallbackFn(arg) {
        $get("<%=HiddenField_ConfirmResponse.ClientID %>").value = arg;
        $find("<%=RadAjaxManager1.ClientID >").ajaxRequest("confirmCallBack");
    }
</script>
 
...
 
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
 
<asp:HiddenField runat="server" ID="HiddenField_ConfirmResponse" />
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  OnAjaxRequest="OnAjaxRequest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadUploadTracciato" >
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="HiddenField_ConfirmResponse" />
                <telerik:AjaxUpdatedControl ControlID="RadUploadTracciato" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadWindowManager runat="server" ID="RadWindowManager1" Width="700px" Modal="true"
    Height="500px" Behaviors="Maximize,Close,Move" VisibleStatusbar="true">
</telerik:RadWindowManager>
 
<telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"></telerik:RadAjaxLoadingPanel>
 
...
 
<telerik:RadAsyncUpload  ID="RadUploadTracciato" ForeColor="#103184" runat="server" PostbackTriggers="bValida" OnFileUploaded="RadAsyncUpload1_FileUploaded"
InitialFileInputsCount="1" MaxFileInputsCount="1" OverwriteExistingFiles="true" ControlObjectsVisibility="None" AllowedFileExtensions=".xlsx,.txt" EnableFileInputSkinning="True" ReadOnlyFileInputs="True"  >      </telerik:RadAsyncUpload>
 
<telerik:RadButton ID="bValida" Width="100" runat="server" Class="BtnAxa" Text="Carica" Style="margin-left: 75px !important;" ></telerik:RadButton>

 

In my .cs:

 

public void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
    {
    const int MaxTotalBytes = 20000;
 
    if (e.File.ContentLength < MaxTotalBytes)
    {
        UploadFile();
    }
    else
    {
 
        RadWindowManagerValidazione.RadConfirm("Il file è molto grande. Il caricamento potrebbe metterci qualche minuto",
            "confirmCallbackFn", 400, null, null, "Attenzione!");
    }
}
 
 
protected void OnAjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
    if (e.Argument == "confirmCallBack" && HiddenField_ConfirmResponse.Value == "true")
    {
        UploadFile();
    }
}
 
 
protected void UploadFile()
{
    if (RadUploadTracciato.UploadedFiles.Count > 0) // is alwais == 0 :(
    {...}
}

 

 

 Someone can help me?

 

 

 

 

 

 

Ivan Danchev
Telerik team
 answered on 28 Jan 2016
3 answers
329 views

Hello

I have a simple RadGrid bind on EntityDataSource,

when i pass AllowSorting="True", the header bar becomes invisible, Is he missing something?

 

<asp:EntityDataSource ID="MyData" runat="server" ConnectionString="name=AGIDE4_DEVEntities"
    OnSelecting="MyData_Selecting" OnSelected="MyData_Selected"
    DefaultContainerName="AGIDE4_DEVEntities" AutoSort="False"
    EntitySetName="CompteConnexion_Profil_Parametres" EntityTypeFilter="CompteConnexion_Profil_Parametres"
    EnableUpdate="True" EnableDelete="False" EnableInsert="False">
</asp:EntityDataSource>
 
<telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
 
<telerik:RadAjaxPanel runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
    <telerik:RadGrid ID="RadGrid1" runat="server" EnableHeaderContextMenu="true" DataSourceID="MyData"
        OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"
        OnPreRender="RadGrid1_PreRender" OnColumnCreated="RadGrid1_ColumnCreated"
        OnColumnsReorder="RadGrid1_ColumnsReorder" OnEditCommand="RadGrid1_EditCommand"      
        PageSize="100" VirtualItemCount="100" ClientSettings-AllowColumnHide="false"
        AutoGenerateHierarchy="false" AutoGenerateColumns="true" AllowPaging="true"  AllowSorting="False"
        AllowFilteringByColumn="true">   
        <ClientSettings
            Virtualization-RetrievedItemsPerRequest="500"
            Virtualization-EnableCurrentPageScrollOnly="false"
            Virtualization-EnableVirtualization="false"
            Virtualization-ItemsPerView="100"
            Virtualization-InitiallyCachedItemsCount="500"
            Scrolling-EnableVirtualScrollPaging="false"
            Scrolling-AllowScroll="true"
            Scrolling-UseStaticHeaders="true"
            ReorderColumnsOnClient="true"
            AllowColumnsReorder="true"
            Selecting-AllowRowSelect="true"           
            ColumnsReorderMethod="Reorder" />
 
    </telerik:RadGrid>
 
</telerik:RadAjaxPanel>
Viktor Tachev
Telerik team
 answered on 28 Jan 2016
1 answer
326 views

Hello,

 

I would like to set OnNeedDataSource and OnFilterCheckListItemsRequested in C# and not in aspx.

 

When having this line in Default.aspx it all works fine:

<telerik:RadGrid ID="RadGrid2" runat="server" Width="750px" OnNeedDataSource="RadGrid2_NeedDataSource"
        OnFilterCheckListItemsRequested="RadGrid2_FilterCheckListItemsRequested">

 

But I would like to get everything but ID and runat to Default.aspx.cs.

Like so:

RadGrid2.MasterTableView.DataKeyNames = new string[] { "ID" };
RadGrid2.AllowPaging = true;
RadGrid2.AllowSorting = true;
RadGrid2.GroupingEnabled = true;
RadGrid2.GroupPanelPosition = GridGroupPanelPosition.Top;
RadGrid2.AllowFilteringByColumn = true;
RadGrid2.FilterType = GridFilterType.HeaderContext;
RadGrid2.EnableHeaderContextMenu = true;
RadGrid2.EnableHeaderContextFilterMenu = true;

 

But when adding these:

RadGrid2.OnNeedDataSource
RadGrid2.OnFilterCheckListItemsRequested

I get an error saying these are inaccessible due to their protection level.

So how can I assign RadGrid2_NeedDataSource and RadGrid2_FilterCheckListItemsRequested in C#?

Viktor Tachev
Telerik team
 answered on 28 Jan 2016
1 answer
260 views

I recently upgraded my UI for ASP.NET AJAX using the Telerik control panel. After doing this, my project would no longer compile. My treeview control was "Not found in current context." I was able to view the control in design view and see that it was correctly recognized. Nothing had changed, and yet the error. I've seen this before where Visual Studio somehow gets confused linking the designer and the code behind, and to solve this I've always done the following: I browse Solution Explorer to the ASPX designer page. To be clear, I delete the [My Page].aspx.designer.cs file. Then using Visual Studio, I convert the page to a web application. In Visual studio 2012, you did this by simply right clicking the ASPX file in Solution Explorer and "Convert to Web Application." In Visual Studio 2013, this option moved under the Project menu. But in Visual Studio 2015, although it remains in the same location as VS 2013, it doesn't do anything.

To resolve my "not found in current context" issue, I opened Visual Studio 2012, deleted the aspx.designer.cs file and converted the page to a web application. The new designer file popped right up. I compiled. The project built fine. Next, I opened it in VS 2015. Again I compiled it. And again it worked fine. There is a bug in VS 2015. It won't correctly build the designer file. Hopefully you won't waste hours on this like I did!

Momchil
Telerik team
 answered on 28 Jan 2016
3 answers
331 views

Is there a way to prevent the temporarily files from being deleted when IIS application pool is recycled?  

Peter Filipov
Telerik team
 answered on 28 Jan 2016
6 answers
167 views
Hi,

I have a RadGrid binding to a datatable which works fine when the active page of the Wizard is set to the be page of the wizard where the RadGrid is, however if the RadGrid is a wizard page that is not displaying when the page first loads the grid will not display correctly.

<asp:Wizard ID="ConnectorWizard" runat="server" ActiveStepIndex="0"   
<WizardSteps> 
     <asp:WizardStep Title="Configuration"
     </asp:WizardStep>                              
     <asp:WizardStep Title="Devices Configuration">                             
          <telerik:RadGrid ID="CTIMonitorGrid" runat="server" AutoGenerateColumns="true"
          </telerik:RadGrid> 
</WizardSteps> 
</asp:Wizard> 

so if i set the ActiveStepIndex to 1 it will display the grid but not if set to 0

I am populating the grid on the page load by using

        DataTable dtCTIMonitors = webSess.MasterSystem.CTISystem.SelectCTIMonitorsView(3);       
        CTIMonitorGrid.DataSource = dtCTIMonitors

I have tried populating the grid each time the pageindex of the wizard control changes - but this does not seem to make any difference.

thanks
Toby


Eyup
Telerik team
 answered on 28 Jan 2016
10 answers
239 views
How to set scrabbler for all day event section if events crossing more than some height. if we create more than 20 events, Time slot is not showing in the scheduler. find attached screen shots for the same.

Please let us provide the solution ASAP.

Thanks in advance.


Dhiraj
Top achievements
Rank 1
 answered on 28 Jan 2016
7 answers
491 views

Folks, environment:  UI for ASP.Net Ajax Q1 2016 With VS 2013. and using below Telerik link as a prototype in my project.

I have a sql table in SQL Server that has 2 columns, 1) Link 2) URL (i.e. https://www.google.com/ or https://www.yahoo.com/) In my edit form, 
hyperlink button is pulling data (i.e. URL in Item Databound event.  Works fine.

  <table>
          <tr>
            <td style="font-size: 11px">Community District: </td>
            <td>
                <asp:TextBox ID="CDTextBox" Font-Size="11px" Text='<%# Bind( "CD") %>'
                    runat="server" TabIndex="8">
 
                </asp:TextBox>
                     
                <asp:HyperLink ID="HyperLinkCD" Style="text-decoration: underline; border-color: InfoBackground; margin: inherit; font-size: 12px; color: #228B22; font-family: Calibri; font-weight: 700"
                 Text="Link" Target="_blank"
                 runat="server" TabIndex="9"></asp:HyperLink>
            </td>
        </tr>
 
</table>
   
  protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    
   {  
 
        
    if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name == "Master")
    {
 
        GridEditableItem editem = (GridEditableItem)e.Item;
        TextBox txtcd = (TextBox)editem.FindControl("CDTextBox");
        string Stcd = txtcd.Text.ToString().TrimEnd();
        SqlCommand cmdcontrol = new SqlCommand("SELECT Link from Cd_Link" +
            "WHERE [CD] = '" + Stcd + "'", SqlConnection);
 
 
         SqlConnection.Open();
         
         SqlDataReader objDR = cmdcontrol.ExecuteReader();
         if (objDR.Read())
           {
        
               string stnycUrlLink = objDR["Link"].ToString().TrimEnd(); Pulling URL from SQL Column ex: https://www.google.com/ or https://www.yahoo.com/
               stnycUrlLink = "" + stnycUrlLink + "";
             
               HyperLink hyperLinkCD = (HyperLink)editem.FindControl("HyperLinkCD");
               hyperLinkCD.NavigateUrl = stnycUrlLink;
               hyperLinkCD.Attributes["href"] = "#";
               hyperLinkCD.Attributes["onclick"] = String.Format("return Show_CDMap('{0}');", stnycUrlLink);
               Session["MapSource"] = "Program";
               Session["Sturl"] = stnycUrlLink;
               
           }
                  
       }
         
  }
    
   function Show_CDMap(seltxt)
   {
               var seltxtbx = seltxt.value;
               alert(seltxt);       ex: https://www.google.com/ or https://www.yahoo.com/
               var oWind = window.radopen("ShowCDMaps.aspx", "UserListDialog");
               oWind.setSize(document.body.scrollWidth - 170, document.body.scrollHeight + 180);
               oWind.set_modal(true);
               oWind.Center();
               oWind.Maximize();
 
              return false;
       }
 
    

I would like to pass that URL to edit form and open that URL. Another word if hyperlink button is grabing https://www.yahoo.com/ from  SQL Table, then open https://www.yahoo.com/

inside edit dialog form.

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

My codes are below. Any help will be appreciated.
gc_0620

Marin Bratanov
Telerik team
 answered on 28 Jan 2016
1 answer
76 views
My developer license was active until 10/2012 and since then there have been many updates to the telerik products.  Using the version I have available to me, there is issues with the grid rendering correctly (and even freezing) on an IE11 browser as well as it does not support the new office formats (docx, xlsx, etc).  If I were to renew the license to get the latest version of telerik, will the grid issue rendering be resolved?  All I see in the browser support page for the current version is that it says it supports IE8+.  I just want to be sure spending the 4k for the renewal license is going to solve our issues.  Thanks!
Marin Bratanov
Telerik team
 answered on 28 Jan 2016
9 answers
152 views
I have a grid I am trying to do a batch update but I need to loop through the grid and save all the values.  I need to be able to get any value that was update along with values that were left alone.  Is this possible?  All I have been able to find is how to get new values or the old values.  I need them both at the same time in a loop through the grid so when my user hits the save button I can save the entire grid to a new database table.  vb.net.

Thanks,
Eyup
Telerik team
 answered on 28 Jan 2016
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?