Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
291 views
Hi, I've a problem very stupid.
I want use a RadWindow as "Confirm dialog" for an action.
The problem is the text of RadWindow.
If I set the title of RadWindow directly work very well, if I use a variable as title
the radwindow not work (click of button don't show me the radwindow)
 

PAGE ASPX

 <asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function confirmCallbackFn(arg) {
                if (arg) //the user clicked OK
                {
                    __doPostBack("<%=HiddenButton.UniqueID %>", "");
                }
            }
        </script>
    </telerik:RadCodeBlock>
 
    <asp:Button ID="Button1" Text="call the RadConfirm" OnClick="Button1_Click" runat="server" />
    <asp:Button ID="HiddenButton" Text="" Style="display: none;" OnClick="HiddenButton_Click" runat="server" />

 

Example A : This Work 

protected void Button1_Click(object sender, EventArgs e)
{          
     rwmMain.RadConfirm("Are you sure you want to perform this action?", "confirmCallbackFn", 300, 200, null, "Confirm");
}

Example B : This work

protected void Button1_Click(object sender, EventArgs e)
{          
     string message = "Are you sure you want to perform this action?";
     rwmMain.RadConfirm(message , "confirmCallbackFn", 300, 200, null, "Confirm");
}

 

Example c : This not work

protected void Button1_Click(object sender, EventArgs e)
{         
     string message = GetGlobalResourceObject("MainResources", "DeleteConfirmCompany").ToString();
     rwmMain.RadConfirm(message , "confirmCallbackFn", 300, 200, null, "Confirm");
}

Example D : This not work

 

protected void Button1_Click(object sender, EventArgs e)
{        
     string message = lblDeleteConfirm.Text;
     rwmMain.RadConfirm(message , "confirmCallbackFn", 300, 200, null, "Confirm");
}

 

I must translate the text.

 

lupotana
Top achievements
Rank 1
 answered on 01 Jul 2015
6 answers
367 views
How can the last node in a RadNavigation control be right-aligned?

Referring to the attached picture and the HTML below I'd like to right-align the "navNodeSearchBox" node within the RadNavigation control while all other items remain left-aligned.

                <div id="divNavigation" class="pageWidthElementPlus5px" style="vertical-align:top; display:block; margin-left:-1px; text-align:left " >
                    <telerik:RadNavigation ID="radNavigation1" runat="server" MenuButtonPosition="Right" BorderStyle="None" BorderColor="Transparent" BorderWidth="0px" >
                        <Nodes>
                            <telerik:NavigationNode ID="navNodeHome" Text="Home" runat="server"></telerik:NavigationNode>
                            <telerik:NavigationNode ID="navNodeCategories" Text="Categories" runat="server"></telerik:NavigationNode>
                            <telerik:NavigationNode ID="navNodeSearch" Text="Search" runat="server"></telerik:NavigationNode>
                            <telerik:NavigationNode ID="navNodeView" Text="View" runat="server"></telerik:NavigationNode>
                            <telerik:NavigationNode ID="navNodeAbout" Text="About" runat="server"></telerik:NavigationNode>
                            <telerik:NavigationNode ID="navNodeMyAccount" Text="My Account" runat="server"></telerik:NavigationNode>
                            <telerik:NavigationNode ID="navNodeSearchBox" Text="search videos" runat="server" CssClass="searchBoxWrapper" Width="400">
                                <NodeTemplate>
                                    <telerik:RadSearchBox ID="RadSearchBox1" runat="server" Width="370"></telerik:RadSearchBox>
                                </NodeTemplate>
                            </telerik:NavigationNode>
                        </Nodes>
                    </telerik:RadNavigation>
                </div>
Magdalena
Telerik team
 answered on 01 Jul 2015
3 answers
93 views

Currently, We are using ‘telerik:RadUpload’control to browse file from network location. ‘telerik:RadUpload’ is not allowed to browse FTP site using IE; however we can browse FTP site using Firefox and Chrome browser.

How can we upload/download file from FTP site using IE browser?? 

 

Nileshkumar
Top achievements
Rank 1
 answered on 01 Jul 2015
3 answers
258 views

Hi everybody,

I want to store uploaded files into Different drive (suppose E:drive) and want to specify upload file in web config file. 

  <add key="Telerik.AsyncUpload.TemporaryFolder" value="D:\temp-backup"/>

How to refer in the code block.

  protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
        {
            List<ListItem> files = new List<ListItem>();
            int counter = 1;
            var file = e.File;
                string targetFolder = AsyncUpload1.TargetFolder;
                string targetFileName = System.IO.Path.Combine(targetFolder,
                    file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());
                while (System.IO.File.Exists(targetFileName))
                {
                    counter++;
                    targetFileName = System.IO.Path.Combine(targetFolder,
                        file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());
     
                }
          
               file.SaveAs(targetFileName);

}

where should i specify the appsetting string? THanks in advance

Dimitar
Telerik team
 answered on 01 Jul 2015
3 answers
92 views

Hi,

I gave Items per request as 50 records. So 1st time you scroll the list has 50 Records,2nd time you scroll the list has 100 records and 3rd time you scroll the list has 150 records ..etc. I have total 4050 records are available.

But here problem is it starting at the beginning of the list instead of the next displayed records. i.e. when you scroll till the end and it loads next 50 records and jumps to first item of total loaded list instead pointing to the 51 record. 

 So how to start scroll from the next loaded list . i.e. 1st time you scroll will be at the start 1 Record, 2nd time scroll will be at the start of 51 record etc...

Ivan Danchev
Telerik team
 answered on 01 Jul 2015
3 answers
544 views
Hi,
The following code can be used to get all the items in RadGrid [client side].

var masterTable = $find("<%= Radgrid1.ClientID %>").get_masterTableView();
var rows = masterTable.get_dataItems();

How can I get / traverse all the items in a grouping in RadGrid? [client side]. 

Thanks for your help.
http://www.megasearches.com/ 

Radoslav
Telerik team
 answered on 01 Jul 2015
1 answer
102 views

Sorry I wasn't in web development for years... so this mobile design trend is completely new to me.

Anyways, supposed I want to go with a 3 column design.  I want to be able to "minimize" the left column in XS or SM mode (so that I can make the column reappear by either clicking a tiny column, or swipe from the left bezel to screen.  Is this possible?

Magdalena
Telerik team
 answered on 01 Jul 2015
4 answers
238 views
Hi,

I'm converting a Radgrid to a TreeList (user wants to be able to expand/collapse) and I just discovered that the TreeList doesn't use the DataKeyNames the same way the RadGrid does. (I want to access some properties that are part of the query, but not shown in the TreeList).

I also discovered that the ClientDataKeyNames does work, so now I'm faced with converting some server-side code to client-side code.
But I can't get it to work.

On server-side I had this in the ItemDataBound event: (this was for the RadGrid)

If (e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("OPLEIDING_GEBIED_NIVEAU") > 0) Then
    CType(dataBoundItem.FindControl("chkIsBeroepsdeel"), CheckBox).Visible = False
End If

I've been trying to convert this to client-side code using the ItemCreated event:

function ItemCreated(sender, eventArgs) {
    var item = eventArgs.get_item();
 
    if (item.get_dataKeyValue("OPLEIDING_GEBIED_NIVEAU") > 0) {
        item.findControl("chkDoorrekenen").style.display = 'none';
    }
}
but this gives me an error message: 

JavaScript runtime error: Object doesn't support property or method 'findControl'

How can I do this client side?

Cheers,
CJ



Eyup
Telerik team
 answered on 01 Jul 2015
5 answers
166 views

Hello Telerik,

 

I am using ASP.Net Ajax Ribbon Bar control.

 

I am facing problem of flickering ribbon bar while refreshing.

My page completely loads in approximately 1 sec. Until the page is fully loaded, the Ribbon bar is partially created as attached image (on_page_loading.png).

And once the page is loaded, ribbon bar is completely created as attached image(after_page_load.png)

This happens at the time of page refresh as well as page postback.

I want ribbon bar to be created at once or at least appear only after it is completely created.

Please advise.

Ivan Zhekov
Telerik team
 answered on 01 Jul 2015
18 answers
128 views

Hi,

 I'm using a subclassed RadHtmlField field control on page layouts in a SharePoint 2013 environment to include the editor. Most of what I need works except for the following:

1. When I toggle to the full screen mode, selecting the 'Insert Link' option opens up the 'Select an Asset' SharePoint dialog. This all works fine, but when a selection is made & the dialog closes, the underlying RadEditor goes back to normal mode with the toggle full screen button depressed. This causes the page to sort of freeze until the full screen toggle button is raised again.

2. I add content such as this:

<div>
                                                        <div class="tile tile-image-top-left">
                                                            <div data-collapse="mobile" data-collapse-default="close">
                                                                <button data-collapse="control" data-desktop="exclude">Top Left</button>
                                                                <div data-collapse="content">
                                                                    <div class="tile-image">
                                                                        <img alt="Top Left" src="images/icon-tile-dummy-image.png" />
                                                                    </div>
                                                                    <div class="tile-title tile-title-background">
                                                                        <p>Top Left</p>
                                                                    </div>
                                                                    <div class="tile-description">
                                                                        <p>This demonstrates how a tile can be used for diplaying an image on the top left of the container. Any text around the tile image will wrap around the image associated with the tile.</p>
                                                                        <p>Additionally, the tile can contain HTML content including hyperlinks and other images if required.</p>
                                                                        <p><ul><li><a href="#">Browse to website 1</a></li></ul></p>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>

But the editor removes the <button> element. 

Here are the contents of the files that you might find useful:

Sub-classed class

public class CustomRadHtmlField : Telerik.SharePoint.FieldEditor.RadHtmlField
    {
        #region Protected Methods
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            ConfigureRadHtmlField();
        }
 
        protected override bool AllowFirstFocus { get { return false; } }
        #endregion
 
        #region Internal Methods
        internal static void ConfigureRadEditorControl(ref SPRadEditor editor)
        {
            editor.ConfigFile = "/_layouts/15/divportals/telerik/configfile.xml";
            editor.ToolsFile = "/_layouts/15/divportals/telerik/toolsfile.xml";
            editor.EnsureToolsFileLoaded();
            editor.ContentAreaMode = EditorContentAreaMode.Iframe;
 
            editor.EnableFilter(EditorFilters.ConvertTags );
            editor.DisableFilter(EditorFilters.EncodeScripts | EditorFilters.RemoveScripts);
            editor.EditModes = EditModes.All;
 
            editor.ToolbarMode = EditorToolbarMode.RibbonBarPageTop;
            editor.NewLineMode = EditorNewLineModes.Div;
            editor.ContextMenus.Clear();
            editor.EnableEmbeddedScripts = true;
            editor.EnableEmbeddedSkins = true;
        }
        #endregion
 
        #region Private Methods
        private void ConfigureRadHtmlField()
        {
            this.AllowScripts = false;
            this.AllowSpecialTags = false;
            this.AllowFonts = false;
 
            CustomRadHtmlField.ConfigureRadEditorControl(ref this.radEditorControl);
        }
        #endregion               
    }
 

ConfigFile.xml

<configuration>
  <property name="Skin">Default</property>
  <property name="ToolbarMode">Default</property>
  <property name="ContentAreaMode">IFRAME</property>
  <property name="DocumentsFilters">
    <item>*.*</item>
  </property>
  <property name="OnClientLoad">setAutoWidthForRadEditorControls</property>
  <property name="ImagesPaths">
    <item>SiteCollectionImages</item>
  </property>
  <property name="MaxDocumentSize">524288000</property>
  <property name="MaxImageSize">524288000</property>
  <property name="MaxFlashSize">524288000</property>
  <property name="MaxMediaSize">524288000</property>
  <property name="MaxSilverlightSize">524288000</property>
  <property name="StripFormattingOptions">MSWordRemoveAll,Css,Font</property>
</configuration>
 

setAutoWidthForRadEditorControls JavaScript function

function setAutoWidthForRadEditorControls() {
    // Set max width for all rad editor controls that appear in the main content place holder
    var radEditorControl = $(".radEditorControl");
    if (radEditorControl) {
        radEditorControl.find(".reContentArea").width(Math.ceil(radEditorControl.width() * 0.98));
    }
}

 

 

 

 

 

 

Ken
Top achievements
Rank 1
 answered on 01 Jul 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?