Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
56 views
Hi,

I have two related combobox controls . The second combobox (disabled by default) becomes enabled by selecting an item in the first combobox.
By selecting an item in the first control, the sencond one become enabled and a TEXT is added to the URL (View attached screen-shot). What is that? and how can I hide it (always). I mean, I don't need that the URL be affected by the web controls.

Regards,
Bader
Kalina
Telerik team
 answered on 25 Oct 2012
1 answer
141 views
Hi, 

we have a Grid with a couple of GridNumericColumns.
We want to load all rows in this Grid in edit mode when the page loads.

With about 50 items in the grid, the page loads relatively fast without about 1 seconds of Javascript execution measured in the Internet Explorer Developer Toolbar.

With 150 items there is noticeable lag in the browser after the items are displayed. Dev Toolbar profiler registers about 6 seconds of Javascript execution.

Wotj 250 items loaded the browser hangs on load, we get a long loading Javascript warning from Internet Explorer, and the profiler shows about 20 seconds of Javascript execution.

When removing the GridNumericColumns and replacing them with regular GridBoundColumns the rendering is blazing fast again (Profiler registers < 50ms of Javascript exeuction).

Here is sample code for you to reproduce the issue:
<telerik:RadScriptManager runat="server" ID="sm1">
       </telerik:RadScriptManager>
        
       <telerik:RadTextBox ID="itemcount" Label="ItemCount" runat="server"></telerik:RadTextBox>
       <asp:Button runat="server" OnClick="OnClick" Text="Reload"/>
        
       <telerik:RadGrid ID="grid" runat="server" Width="990px" EnableLinqExpressions="False"
           CellSpacing="0" DataSourceID="ObjectDataSource2" GridLines="None" OnPreRender="grid_OnPreRender" AllowMultiRowEdit="True">
           <FilterMenu EnableImageSprites="False">
           </FilterMenu>
           <MasterTableView AutoGenerateColumns="False" DataSourceID="ObjectDataSource2" AllowSorting="True" EditMode="InPlace">
               <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
               <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
               </RowIndicatorColumn>
               <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
               </ExpandCollapseColumn>
               <Columns>
                   <telerik:GridNumericColumn DataField="Value1" FilterControlAltText="Filter Value1 column"
                       HeaderText="Value1" SortExpression="Value1" UniqueName="Value1" runat="server">
                   </telerik:GridNumericColumn>
                   <telerik:GridNumericColumn DataField="Value2" FilterControlAltText="Filter Value2 column"
                       HeaderText="Value2" SortExpression="Value2" UniqueName="Value2" runat="server">
                   </telerik:GridNumericColumn>
                   <telerik:GridNumericColumn DataField="Value3" FilterControlAltText="Filter Value2 column"
                       HeaderText="Value3" SortExpression="Value3" UniqueName="Value3" runat="server">
                   </telerik:GridNumericColumn>
                   <telerik:GridNumericColumn DataField="Value4" FilterControlAltText="Filter Value2 column"
                       HeaderText="Value4" SortExpression="Value4" UniqueName="Value4" runat="server">
                   </telerik:GridNumericColumn>
               </Columns>
               <EditFormSettings>
                   <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                   </EditColumn>
               </EditFormSettings>
           </MasterTableView>
       </telerik:RadGrid>
       <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetObjects"
           TypeName="SimpleObjectProvider">
           <SelectParameters>
               <asp:ControlParameter runat="server" ControlID="itemcount" Type="Int32" Name="itemcount"/>
           </SelectParameters>
       </asp:ObjectDataSource>


 
protected void grid_OnPreRender(object sender, EventArgs e)
    {
        foreach (GridItem item in grid.Items)
        {
            item.Edit = true;
        }
 
        grid.Rebind();
    }
 
    protected void OnClick(object sender, EventArgs e)
    {
        grid.Rebind();
    }

public class SimpleObjectProvider
{
    public int itemcount = 100;
 
    /// <summary>
    /// Initializes a new instance of the <see cref="SimpleObjectProvider"/> class.
    /// </summary>
    public SimpleObjectProvider()
    {
    }
 
    /// <summary>
    /// Simple Select Method
    /// </summary>
    /// <returns>List of Objects</returns>
    public List<SimpleObject> GetObjects(int itemcount)
    {
        var simpleObjects = new List<SimpleObject>();
 
        for (int i = 1; i <= itemcount; i++)
        {
            simpleObjects.Add(new SimpleObject(i, i * i, 1m / i, 1.4m * i));
        }
 
        return simpleObjects;
    }
}
 
/// <summary>
/// A simple object
/// </summary>
public class SimpleObject
{
 
    public SimpleObject(decimal value1, decimal value2, decimal value3, decimal value4)
    {
        Value1 = value1;
        Value2 = value2;
        Value3 = value3;
        Value4 = value4;
    }
 
    public decimal Value4 { get; set; }
 
    public decimal Value3 { get; set; }
 
    public decimal Value1 { get; set; }
 
    public decimal Value2 { get; set; }
}


Vasil
Telerik team
 answered on 25 Oct 2012
4 answers
151 views

Hi,

I am trying to implement the load on demand functionality in Org Chart control.
From what I understand from the link1 and link2 is that the whole data (including the data which has already been rendered) needs to be rebound to the control each time a node is expanded. Please correct me if my understanding is wrong. If not, is it possible to implement it in such a way that if a node is expanded, only the children of that node needs to be fetched and bound to the control.
My primary objective is to bind a huge data set to the orgchart control without affecting the performance.
Thanks!

Peter Filipov
Telerik team
 answered on 25 Oct 2012
1 answer
196 views
Hi,

I'm using RadAsyncUpload on my page for uploading photos.I have multiple areas on the same page.It's configured like this:

<div class="photocontainer"><span class="message">
       <ecadis:EcadisLabel ID="lblLeftPhotoView" LabelId="text.leftPhotoView"
        runat="server" />
        <ecadis:EcadisLabel runat="server" ID="lblLeftPhotoViewRequired" LabelId="text.requiredStar" Visible="False"  CssClass="error"/></span>
                    <telerik:RadBinaryImage runat="server" Width="175px" Height="120px" ResizeMode="Crop" ID="leftViewPhoto" SavedImageName="linkerflank.png" ImageUrl="/images/linkerflank.png"/>
                    <span class="invalidLeftPhoto"></span>
                    <telerik:RadAsyncUpload runat="server"
                                            ID="leftPhotoViewAsyncUpload"
                                            MaxFileInputsCount="1"
                                            MaxFileSize="2411724"
                                            OnClientFileUploaded="onLeftPhotoUploaded"
                                            OnFileUploaded="LeftViewPhotoFileUploaded"
                                            AllowedFileExtensions="jpeg,jpg,gif,png,bmp"
                                            OnClientValidationFailed="onLeftPhotoValidationFailed" >
                    </telerik:RadAsyncUpload>
                    <telerik:RadButton runat="server" ID="btnResetLeftPhotoView" AutoPostBack="false" OnClientClicked="leftViewPhotoClearImage">
                    </telerik:RadButton>
                </div>
 
                <div class="photocontainer"><span class="message">
       <ecadis:EcadisLabel ID="lblRightPhotoView" LabelId="text.rightPhotoView" runat="server"/><ecadis:EcadisLabel runat="server" ID="lblRightPhotoViewRequired" LabelId="text.requiredStar" Visible="False" CssClass="error"/></span>
                    <telerik:RadBinaryImage runat="server" Width="175px" Height="120px" ResizeMode="Crop" ID="rightViewPhoto" SavedImageName="rechterflank.png" ImageUrl="/images/rechterflank.png"/>
                    <span class="invalidRightPhoto"></span>
                    <telerik:RadAsyncUpload runat="server"
                                            ID="rightPhotoViewAsyncUpload"
                                            MaxFileInputsCount="1"
                                            MaxFileSize="2411724"
                                            OnClientFileUploaded="onRightPhotoUploaded"
                                            OnFileUploaded="RightViewPhotoFileUploaded"
                                            AllowedFileExtensions="jpeg,jpg,gif,png,bmp"
                                            OnClientValidationFailed="onRightPhotoValidationFailed">
                    </telerik:RadAsyncUpload>
                    <telerik:RadButton runat="server" ID="btnResetRightViewPhoto" AutoPostBack="False" OnClientClicked="rightViewPhotoClearImage" />
                </div>
            </div>
     
            <div class="dragAndDrop WP100">
                <div class="photocontainer"><span class="message">
      <ecadis:EcadisLabel runat="server" ID="lblFrontalPhotoView" LabelId="text.frontalPhotoView"/><ecadis:EcadisLabel runat="server" ID="lblFrontalPhotoViewRequired" LabelId="text.requiredStar" Visible="False" CssClass="error"/></span>
                    <telerik:RadBinaryImage runat="server" Width="175px" Height="120px" ResizeMode="Crop" ID="frontalViewPhoto" SavedImageName="frontaal.png" ImageUrl="/images/frontaal.png"/>
                    <span class="invalidFrontal"></span>
                    <telerik:RadAsyncUpload runat="server"
                                            ID="frontaalPhotoViewAsyncUpload"
                                            MaxFileInputsCount="1"
                                            MaxFileSize="2411724"
                                            OnClientFileUploaded="onFrontalPhotoUploaded"
                                            OnFileUploaded="FrontaalPhotoFileUploaded"
                                            AllowedFileExtensions="jpeg,jpg,gif,png,bmp"
                                            OnClientValidationFailed="onFrontalPhotoValidationFailed">
                    </telerik:RadAsyncUpload>
                    <telerik:RadButton runat="server" ID="btnResetFrontaalViewPhoto" AutoPostBack="False" OnClientClicked="frontaalViewPhotoClearImage"></telerik:RadButton>
                </div>
         
                <div class="photocontainer"><span class="message"><ecadis:EcadisLabel ID="EcadisLabel5" LabelId="text.backPhotoView" runat="server"/><ecadis:EcadisLabel runat="server" ID="lblBackPhotoViewRequired" LabelId="text.requiredStar" Visible="False" CssClass="error"/></span>
                    <telerik:RadBinaryImage runat="server" Width="175px" Height="120px" ResizeMode="Crop" ID="backViewPhoto" SavedImageName="achteraan.png" ImageUrl="/images/achteraan.png" />
                    <span class="invalidBack"></span>
                    <telerik:RadAsyncUpload runat="server"
                                            ID="backPhotoViewAsyncUpload"
                                            MaxFileInputsCount="1"
                                            OnClientFileUploaded="onBackPhotoUploaded"
                                            OnFileUploaded="BackPhotoFileUploaded"
                                            AllowedFileExtensions="jpeg,jpg,gif,png,bmp"
                                            OnClientValidationFailed="onBackPhotoValidationFailed"
                                            MaxFileSize="2411724">
                    </telerik:RadAsyncUpload>
                    <telerik:RadButton runat="server" ID="btnResetBackViewPhoto" AutoPostBack="False" OnClientClicked="backViewPhotoClearImage"></telerik:RadButton>
                </div>
            </div>
     
            <div class="dragAndDrop WP100">
                <div class="photocontainer"><span class="message"><ecadis:EcadisLabel ID="EcadisLabel6" LabelId="text.intFrontPhotoView" runat="server"/><ecadis:EcadisLabel runat="server" ID="lblIntFrontPhotoRequired" LabelId="text.requiredStar" Visible="False" CssClass="error"/></span>
                    <telerik:RadBinaryImage runat="server" Width="175px" Height="120px" ResizeMode="Crop" ID="interiourFrontViewPhoto" SavedImageName="interieur_vooraan.png" ImageUrl="/images/interieur_vooraan.png" />
                    <span class="invalidIntFront"></span>
                    <telerik:RadAsyncUpload runat="server"
                                            ID="interiourFrontViewAsyncUpload"
                                            MaxFileInputsCount="1"
                                            OnClientFileUploaded="onIntFrontPhotoUploaded"
                                            OnFileUploaded="InteriourFrontPhotoFileUploaded"
                                            AllowedFileExtensions="jpeg,jpg,gif,png,bmp"
                                            OnClientValidationFailed="onIntFrontPhotoValidationFailed"
                                            MaxFileSize="2411724"></telerik:RadAsyncUpload>
                    <telerik:RadButton runat="server" ID="btnResetInteriourFrontViewPhoto" AutoPostBack="False" OnClientClicked="interiourFrontViewPhotoClearImage"></telerik:RadButton>
                </div>

On the client side I have the following Javascript:
function onLeftPhotoUploaded(sender, args) {
                       $find("<%=radAjaxManager.ClientID %>").ajaxRequest();
                       $telerik.$(".invalidLeftPhoto").html("");
                       $telerik.$("#lblLeftPhotoViewRequired").html("");
                       setTimeout(function () {                        
                           sender.deleteFileInputAt(0);                        
                       }, 10);
                   }
                   function onLeftPhotoValidationFailed(sender, args) {
                       $telerik.$('.invalidLeftPhoto').html('<%= MasterController.GetLabelValue("text.fileTooBig") %>').addClass("error");
                       sender.deleteFileInputAt(0);
                   }
                   function onRightPhotoUploaded(sender, args) {                      
                       $find("<%=radAjaxManager.ClientID %>").ajaxRequest();
                       $telerik.$(".invalidRightPhoto").html("");
                       $telerik.$("#lblRightPhotoViewRequired").html("");
                       setTimeout(function () {
                           console.log(sender._uploadedFiles.length);
                           sender.deleteFileInputAt(0);                          
                       }, 10);
                   }
                   function onRightPhotoValidationFailed(sender, args) {
                       $telerik.$('.invalidRightPhoto').html('<%= MasterController.GetLabelValue("text.fileTooBig") %>').addClass("error");
                       sender.deleteFileInputAt(0);
                   }


On the server side I have the following code:

protected void LeftViewPhotoFileUploaded(object sender, FileUploadedEventArgs e)
   {           
       string path = Path.Combine(ConfigurationManager.AppSettings["SaveLocation"], PartnerId.ToString(), CarId.ToString(), ConfigurationManager.AppSettings["GeneralPictureLocation"]);
       e.File.SaveAs(Path.Combine(path, "linkerflank.png"));      
       byte[] array = CreateThumbnail(path, "linkerflank.png");        
       leftViewPhoto.DataValue = array;
   }
 
   protected void RightViewPhotoFileUploaded(object sender, FileUploadedEventArgs e)
   {           
       string path = Path.Combine(ConfigurationManager.AppSettings["SaveLocation"], PartnerId.ToString(), CarId.ToString(), ConfigurationManager.AppSettings["GeneralPictureLocation"]);
       e.File.SaveAs(Path.Combine(path, "rechterflank.png"));
       byte[] array = CreateThumbnail(path, "rechterflank.png");
       rightViewPhoto.DataValue = array;
   }

The problem is that when I delete an existing photo from an area, and then upload another photo to another area , the "old" photo is also rendered.I suppose that I can fix this with some cache settings on to the control.Can you help me with this bug?

Thank you.
Peter Filipov
Telerik team
 answered on 25 Oct 2012
3 answers
233 views
I have some appointments and displaying in scheduler control. If the subject text is only two words its fine since it displays in one line but if the subject is long it goes to second line or third line but I can see only the first line. I want to expand the background rectangle as it expands the subject.
Boyan Dimitrov
Telerik team
 answered on 25 Oct 2012
1 answer
27 views
Hi,

I'm using a grid with editing through usercontrols loaded as modal popup.

I'm having a problem finding how to make use of a local resx file in order to localize Edit/Insert new etc in the PopUp Header, I've read the examples, searched the forum to no avail.
Eyup
Telerik team
 answered on 25 Oct 2012
18 answers
824 views
I have been reading alot of the documentation in regards to Customizing Dialogs and I can't seem to work it out. I downloaded the current zip version (2008.1 619). The EditorDialogs folder contains all the dialogs but the docs don't seem to correspond to the current content of dialogs ascx files. For example if I want to hide or disable tabs which are now in a toolbar.
If I customize a dialog how can I use it as the dialogs seem to be embedded in dll's? So I searched a bit more and I found the section on Adding Custom Dialogs and you create a new DialogDefinition class and pass in either a type of dialogType or a string of virtualPath in the constructor. I added the EditorDialogs folder to my project and tried adding the ImageManager.ascx file into contructor but got the 'Object reference not set to an instance of an object' error. Is there another way to do this? 

If that is not possible then I guess I need to create custom dialog from scratch. If I create from scratch then is it possible to utilize existing built in controls such as the widgets controls eg. <widgets:GenericFileLister>. How and what would I need to wire these up. I can think of a lot of custom dialogs that are either existing managers that I alter or taking advantage of a bunch of the widget controls to build dialogs from scratch. I have read alot of the docs and searched forums/knowledge base/code library and found bits and pieces that give me hope but I feel like I am shooting in the dark.

What I specifically want to build now is a dialog based on any of the file browser dialogs, it could be file based or implement a custom FileBrowserContent Provider. The file browser will list mp3 files that when clicked will use a Flash mp3 player to play the selected track so you can preview the track and if the track you want is not there then the user can upload the new track. I know I can build a totally custom dialog but it seems that so much of the functionality is already so close to what I want.

Regards
Axe
IT Dev
Top achievements
Rank 1
 answered on 25 Oct 2012
1 answer
87 views
I have a client side onrowselect function and I am trying to know the row its selecting each time (multi  select using shift/drag). Is there a way to reference that. I don't need to know the row that triggered the event as its multi select, I want to know which row is being selected in each call.

Thanks
Shinu
Top achievements
Rank 2
 answered on 25 Oct 2012
1 answer
128 views
<telerik:GridTemplateColumn DataField="Data" HeaderText="Imagen" UniqueName="Upload">
                                               <ItemTemplate>
                                                   <a class="FotoGrid" href="#" onclick="VerImagen($(this))">
                                                       <telerik:RadBinaryImage ID="RadBinaryImage2" runat="server" AlternateText='<%#Eval("Contenido", "Photo of {0}") %>'
                                                           AutoAdjustImageControlSize="false" DataValue='<%#Eval("Contenido") is DBNull ? null : Eval("Contenido")%>'
                                                           Height="80px" ToolTip='<%#Eval("Contenido", "Photo of {0}") %>' Width="80px" />
                                                   </a>
                                               </ItemTemplate>
                                               <EditItemTemplate>
                                                   <telerik:RadAsyncUpload ID="FotoActualizar" runat="server" AllowedFileExtensions="jpg,jpeg,pdf"
                                                       MaxFileInputsCount="1" MaxFileSize="1048576" ToolTip="Actualizar Archivo">
                                                       <Localization Cancel="Cancelar" Remove="Quitar" Select="Archivo" />
                                                   </telerik:RadAsyncUpload>
                                                   <asp:CustomValidator runat="server" ID="cvUploadFotoMaterial" ClientValidationFunction="validateUploadFoto"
                                                       ErrorMessage="Fotografia es requerido" ForeColor="Red" ValidationGroup="vgGridFotos">*</asp:CustomValidator>
                                               </EditItemTemplate>
                                           </telerik:GridTemplateColumn>

var masterTable = $find("<%=gridFotos.ClientID %>").get_masterTableView();
                var upload = masterTable.get_dataItems()[0].findControl('FotoActualizar');

doesn't' work
Shinu
Top achievements
Rank 2
 answered on 25 Oct 2012
2 answers
117 views
Hi all,
       I have a radcombox present in a radwindow the autopostback is set to true and when i select a item in the radcombo the radwindow is being closed due to postback what to do???
Naveen kumar
Top achievements
Rank 1
 answered on 25 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?