Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
72 views
I have a function that will change the page of the current radwindow, or open a new one to the provided url. I have 2 questions regarding this function.

function ChangePage(FileName)  
{  
if (window.frameElement) {  
        // A window is already open - Redirect        
        GetRadWindow().SetUrl(FileName);  
          
        // Resize the window  
        var curWindowSize = GetRadWindow().getWindowBounds();  
        GetRadWindow().center();  
        GetRadWindow().setSize(width,height);  
        GetRadWindow().set_modal(modal);  
        //GetRadWindow().show();  
    } else {  
        // No window - open a new one  
        openRadWindow(FileName,height,width,modal,0,1,1,qty);  
    }  
}  

#1 - I recently noticed that my modal settings were getting changed after updating the url of the window. I would start with a non-modal window, click the button that triggers the change and have the window immediately go modal upon redirecting the url. I narrowed it down the the GetRadWindow().show() line being the culprit. What does show() do? The script still seems to work without it...is it necessary?

#2 - Can I change the window behaviors at the same time I'm setting the new url? Some of the destinations require the reload window and no close button when coming from the initial window that only has close.
Using version 2008.1.515.20.
Nik
Top achievements
Rank 1
 answered on 29 Oct 2009
1 answer
155 views
Hi,

I have 2 comboboxes on a page. When the user changes the first combobox i would like to focus the second one.
I'm using the OnClientSelectedIndexChanged event of the first combobox to achieve this. On IndexChanged calls the following javascript method
function FirstComboBox_IndexChanged(sender, args) {  
    var comboBox = $find("secondRadComboBox"));  
    if (comboBox != null) {  
        var input = comboBox.get_inputDomElement();  
        window.setTimeout(function() { input.focus(); }, 0);  
    }   
} 

At first i just called input.focus() but i found this post stating i should call window.setTimeout(function() { input.focus() }, 0)
I debugged the code and the focus method gets called but the second combobox doesn't get the focus.

Is this something i can't do in the OnClientSelectedIndexChanged or do i have to call the focus method using another way?
Thanks in advance.
Jeroen Eikmans
Top achievements
Rank 1
 answered on 29 Oct 2009
3 answers
186 views
HI,

I have a RadTreeView. I need to display list box on click of leaf node of the tree. Can anybody help me in this?

Regards,
Medac
Princy
Top achievements
Rank 2
 answered on 29 Oct 2009
1 answer
191 views

I've done quite a bit of searching and reading, and maybe I just don't get it.  Here's my problem.

I have a RadGrid with a nested Detail table.  The Detail Table is configured to use a Form Template.  To bind the values in the Form Template, I'm using markup that looks like this:

 
<asp:Label ID="lblID" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.ServerPowerID" ) %>' ></asp:Label> 
The form populates with data nicely and everything is good.  That form has buttons on it for update and insert:
<asp:Button ID="btnUpdate"  Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update"%>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PowerInsert" : "PowerUpdate" %>'/>  
<asp:Button ID="btnCancel" Text="Cancel" CausesValidation="false" runat="server" CommandName="Cancel"/> 
I'm catching the RadGrid_ItemCommand (and I have verified that it fires).  In other, non-nested grids, I've used code like this to populate a custom data object that updates the database:
if (e.CommandName == "PowerUpdate")  
            {  
                GridEditableItem editedItem = e.Item as GridEditableItem;  
                CMDB.ServerPower power = new CMDB.ServerPower(Convert.ToInt32((editedItem.FindControl("lblID") as Label).Text));  
                power.ServerID= (Convert.ToInt32((editedItem.FindControl("lblServerID") as Label).Text));  
                power.ServerPowerNameID = Convert.ToInt32((editedItem.FindControl("ddlServerPowerName") as DropDownList).SelectedValue);  
                power.ServerPowerCircuitID = Convert.ToInt32((editedItem.FindControl("ddlServerPowerCircuit") as DropDownList).SelectedValue);  
                power.ServerPowerNotes = (editedItem.FindControl("tbNotes") as TextBox).Text;  
                power.Save(User.Identity.Name.ToString());  
                ServerRadGrid.Rebind();  
            } 

The problem is that editedItem is continually null.  Since this code works on non-nested grids with success, I assume that I'm not referencing the nested grid's editable item correctly.  Can someone either point me to a post/tutorial that shows me what the correct way to reference these controls on the nested grid are, or better yet just show me the light with this example? 
Shinu
Top achievements
Rank 2
 answered on 29 Oct 2009
1 answer
157 views
is it possible to use absolute paths as viewpath ?

Because the FileExplorer is in my CMS but I want to show a directory in the website, and the website is in a other directory . For example :
    - The directory of my cms : D:\CMS
    - The directory of my site : D:\Site

So is it possible to show the files of my site, in my CMS (where the fileexplorer is added) ?
Fiko
Telerik team
 answered on 29 Oct 2009
3 answers
318 views
Hello

I have been treking through the forums and documentation to find out how to do this and I am throughly confused!
My Website has a flag that can be changed and when this happens we re-load all the text on the site files.
I can transate the column headers by doing something like this:

 

RadGrid1.Columns[3].HeaderText = Translations.Common.ColumnName 

  

 

 

 

but cannot work out how to do the pager.

I am using the default pager, (ie I haven't set it to anything specific) currently the pager shows
 |< < 12 > >| page size <a dropdown>      .......  11 items in 2 pages

Can I just pass the culture to the grid and it will do it automatically? or is that just wishful thinking and I have to do it my self? Ideally I don't want a custom pager, but I don't get how to get access to the bits to be able to translate the default one?

Thanks in advance

 

Princy
Top achievements
Rank 2
 answered on 29 Oct 2009
4 answers
233 views
Hi, I've got a problem with checking file size on upload. There is not RadUpload object in arguments so line in checkUploadedFilesSize function with args.get_progressData().RadUpload.RequestSize generates error. I searched everywhere for solution, most info linked to
this site: http://www.telerik.com/help/aspnet-ajax/upload_howtoclientfilesize.html, but it doesn't help. I use 2009.2.701.35 version of library.
Here is my aspx markup:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title></title> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
        <Scripts> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
        </Scripts> 
    </telerik:RadScriptManager> 
    <div> 
 
        <script type="text/javascript"> 
            function checkUploadedFilesSize(progressArea, args) { 
                //progressArea.confirmed is a custom variable, 
                // you can use another if you want to 
                if (!progressArea.confirmed && 
       args.get_progressData().RadUpload.RequestSize > 1000000) { 
                    if (confirm("The total size of the selected files" + 
                 " is more than the limit." + 
                 " Do you want to cancel the upload?")) { 
                        progressArea.cancelRequest(); 
                    } 
                    else { 
                        progressArea.confirmed = "confirmed"; 
                    } 
                } 
            } 
        </script> 
 
        <telerik:RadUpload runat="server" ID="RadUpload1" /> 
        <telerik:RadProgressArea runat="server" ID="RadProgressArea1" OnClientProgressUpdating="checkUploadedFilesSize" /> 
        <telerik:RadProgressManager runat="server" ID="RadProgressManager1" /> 
        <asp:Button runat="server" ID="Button1" Text="Upload" OnClick="buttonSubmit_Click" /> 
    </div> 
    </form> 
</body> 
</html> 
 

here is my code behind code:
using System; 
 
using Telerik.Web.UI; 
using Telerik.Web.UI.Upload; 
 
public partial class Default : System.Web.UI.Page  
{ 
    protected void Page_Load(object sender, EventArgs e) 
    { 
            if (!IsPostBack) 
            { 
                //Do not display SelectedFilesCount progress indicator. 
                RadProgressArea1.ProgressIndicators &= ~ProgressIndicators.SelectedFilesCount; 
            } 
 
        } 
 
        protected void buttonSubmit_Click(object sender, System.EventArgs e) 
        { 
            UploadedFile file = RadUpload1.UploadedFiles[0]; //UploadedFile.FromHttpPostedFile(Request.Files[inputFile.UniqueID]); 
 
            if(!Object.Equals(file, null)) 
            { 
                LooongMethodWhichUpdatesTheProgressContext(file); 
            } 
        } 
 
        private void LooongMethodWhichUpdatesTheProgressContext(UploadedFile file) 
        { 
            const int total = 100; 
 
            RadProgressContext progress = RadProgressContext.Current; 
 
            for (int i = 0; i < total; i++) 
            { 
                progress.PrimaryTotal = 1; 
                progress.PrimaryValue = 1; 
                progress.PrimaryPercent = 100; 
 
                progress.SecondaryTotal = total; 
                progress.SecondaryValue = i; 
                progress.SecondaryPercent = i; 
 
                progress.CurrentOperationText = file.GetName() + " is being processed..."; 
 
                if (!Response.IsClientConnected) 
                { 
                    //Cancel button was clicked or the browser was closed, so stop processing 
                    break; 
                } 
 
                //Stall the current thread for 0.1 seconds 
                System.Threading.Thread.Sleep(100); 
            } 
        }    
} 
 

and to be sure here is my web.config (it's more or less template from telerik project template)
<?xml version="1.0"?> 
<configuration> 
    <configSections> 
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> 
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                </sectionGroup> 
            </sectionGroup> 
        </sectionGroup> 
    </configSections> 
    <appSettings/> 
    <connectionStrings/> 
    <system.web> 
        <compilation debug="true"> 
            <assemblies> 
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
            </assemblies> 
        </compilation> 
        <pages> 
            <controls> 
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/> 
            </controls> 
        </pages> 
        <authentication mode="Windows"/> 
        <httpHandlers> 
            <remove verb="*" path="*.asmx"/> 
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> 
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/> 
            <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/> 
            <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/> 
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/> 
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/> 
        </httpHandlers> 
        <httpModules> 
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/> 
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/> 
        </httpModules> 
    <httpRuntime maxRequestLength="102400" executionTimeout="3600"/> 
  </system.web> 
    <system.codedom> 
        <compilers> 
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 
                <providerOption name="CompilerVersion" value="v3.5"/> 
                <providerOption name="WarnAsError" value="false"/> 
            </compiler> 
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 
                <providerOption name="CompilerVersion" value="v3.5"/> 
                <providerOption name="OptionInfer" value="true"/> 
                <providerOption name="WarnAsError" value="false"/> 
            </compiler> 
        </compilers> 
    </system.codedom> 
 
    <system.webServer> 
        <validation validateIntegratedModeConfiguration="false"/> 
        <modules> 
            <remove name="ScriptModule"/> 
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/> 
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/> 
        </modules> 
        <handlers> 
            <remove name="WebServiceHandlerFactory-Integrated"/> 
            <remove name="ScriptHandlerFactory"/> 
            <remove name="ScriptHandlerFactoryAppServices"/> 
            <remove name="ScriptResource"/> 
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
            <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
            <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
            <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
            <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/> 
        </handlers> 
    <security> 
      <requestFiltering> 
        <requestLimits maxAllowedContentLength="1024000000" /> 
      </requestFiltering> 
    </security> 
  </system.webServer> 
    <runtime> 
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
            <dependentAssembly> 
                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> 
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> 
            </dependentAssembly> 
            <dependentAssembly> 
                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> 
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> 
            </dependentAssembly> 
        </assemblyBinding> 
    </runtime> 
</configuration> 

Genady Sergeev
Telerik team
 answered on 29 Oct 2009
1 answer
146 views
Hi, I'm working with a grid and when I go  in the updateCommand  procedure, I try to get the uploadFileContent, but alwasy is null, some one can help me? I have this code.
 Protected Sub gridGaleria_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gridGaleria.UpdateCommand 
        If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then 
 
            Dim editItem As GridEditableItem = DirectCast(e.Item, GridEditableItem) 
            Dim upload As GridBinaryImageColumnEditor = DirectCast(editItem.EditManager.GetColumnEditor("Upload"), GridBinaryImageColumnEditor) 
            Dim db As New aulaDataContext 
            If upload.UploadedFileContent.Count > 0 Then 
                Dim evenFoto = From ev In db.eventosFotos _ 
                           Where ev.idEventoFoto = 1 _ 
                           Select ev 
                For Each renglon In evenFoto 
                    renglon.pathArchivo =     upload.RadUploadControl.UploadedFiles.Item(0).FileName 
                    db.SubmitChanges() 
                Next 
 
            End If 
        End If 
    End Sub 

Sebastian
Telerik team
 answered on 29 Oct 2009
1 answer
80 views
Hi

I'm new to using web services with radcombo boxes

I've gotten that far and its working well

I would like to add another item to the radcombo specified by me but building the radcombo with this 1 item screws up the box and you either see the appended item or the web service stuff and not both

Any ideas?
Veselin Vasilev
Telerik team
 answered on 29 Oct 2009
1 answer
149 views
I want to put a button in the NoRecordsTemplate of a grid
Unfortunately the code-behind doesn' t recognize the ID of the button(Error    The name 'cmdButton' does not exist in the current context)

<NoRecordsTemplate> 
   <asp:Button ID="cmdButton" /> 
</NoRecordsTemplate> 

cmdButton.Visible = false; 
 
Princy
Top achievements
Rank 2
 answered on 29 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?