Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
704 views
Hello,
I've got a basic project working that allows a user to "stamp" custom predefined text or statuses on an image. I have it now always adding the new text in the upper corner, but that may not be a good place for different images. Does anyone have any suggestions on a good way to allow the user to specify the position of the text before it is inserted. Ideally, I could allow them to drag it to the new location after I add the text, but from other posts, it doesn't appear that is possible.I'd like to avoid a custom popup dialog if I can, because right now, they just click a custom icon, and it stamps the predefined data.
Thanks,
Adrian
Marbry
Top achievements
Rank 1
 answered on 27 Mar 2015
7 answers
2.0K+ views
Hi all,

I found that EmptyText doesn't work properly for RadTextBox if it has TextMode=Password.
I use v.2012.2.607.35
Also, I noticed that it doesn't work even on demo page:
http://demos.telerik.com/aspnet-ajax/input/examples/radtextbox/firstlook/defaultcs.aspx 

Joe
Top achievements
Rank 2
 answered on 27 Mar 2015
2 answers
77 views
I am seeing weird results when removing bulleted list items (either ordered or unordered).  I am using NewLineMode="div" because we want to wrap our blocks in div tags instead of paragraph tags.  But, when removing the bullets, it wraps them in paragraph tags instead of divs like we want and would expect.  But, I have also tried the demo at http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx and it properly wraps the removed entries in the NewLineMode value of div that I had selected.  Right now, I am using the 2014.3.1209.35 version of the Telerik AJAX ASP.NET controls.  To eliminate other variables, I made a test project with just a page with a RadEditor on it.  I have tried this in IE 11, Firefox 36, and Chrome 41.  I am confused that the demo behaves differently than the control in my project.

Steps to reproduce:
- Set the NewLineMode to div.
- Create an ordered or unordered list with 6 items.  It does not matter if you start the list first and then press the Bulleted List or Numbered List button or highlight the entries and then press the button.  The HTML looks like this:
    <ul>
        <li>One</li>
        <li>Two</li>
        <li>Three</li>
        <li>Four</li>
        <li>Five</li>
        <li>Six</li>
    </ul>
- Highlight the 3rd and 4th entries.
- The 3rd and 4th entries will be removed from the bulleted list and the list broken into two pieces.  The entries are wrapped in paragraph tags instead of div tags.  Since I am using NewLineMode="div", I would expect Three and Four to be wrapped in div tags.
    <ul>
        <li>One</li>
        <li>Two</li>
    </ul>
    <p>Three</p>
    <p>Four</p>
    <ul>
        <li>Five</li>
        <li>Six</li>
    </ul>

This is what I would expect instead:
    <ul>
        <li>One</li>
        <li>Two</li>
    </ul>
    <div>Three</div>
    <div>Four</div>
    <ul>
        <li>Five</li>
        <li>Six</li>
    </ul>
Mike
Top achievements
Rank 1
 answered on 27 Mar 2015
1 answer
93 views
Hello Team

I am using Telerik RadEditor where I set the max length using JavaScript but when I paste the data from Clipboard to Editor, I gets the message
" Do you want to allow this webpages to access your Clipboards?" if I click Don'tAllow and do the paste again then JavaScript which using to control the max length gets fail and user can paste large amount of data on Editor.

<telerik:RadEditor ContentAreaCssFile="~/Styles/EditorContentAreaCss.css" ID="txtDetails" MaxTextLength="8000"
runat="server" EditModes="Design" EnableResize="false" Height="150px" OnClientLoad="EditorMaxLengthvalidation8000"
OnClientPasteHtml="OnClientPasteHtml8000" NewLineBr="false" NewLineMode="P" Style="border: 1px solid Navy;
background-color: White;" ToolsFile="~/App_Data/RadControls/Editor/ToolsFile.xml"
Width="503px">
<CssFiles>
<telerik:EditorCssFile Value="~/Styles/Editor.css" />
</CssFiles>
</telerik:RadEditor>


JavaScript

function OnClientPasteHtml8000(editor, args) {
var limitCharacters = 8000;
OnClientPasteHtml(editor, args, limitCharacters);
}

function OnClientPasteHtml(editor, args, limitCharacters) {
try {
var commandName = args.get_commandName();
var value = args.get_value();
var lengthWithOutHtml = 0;
var lengthWithHtml = 0;
var lengthDifference = 0;
var messagePaste = 'Max length exceeded to ' + limitCharacters + ' characters. Content cannot paste.';
lengthWithHtml = value.length;

//This condition raise when user paste only text which does't contains any HTML code.
//So due to this we don't suppose to update the 'value' field.
if (value != "") {
//value = $(value).text();
lengthWithOutHtml = value.length;
lengthDifference = lengthWithHtml - lengthWithOutHtml;
}
if (commandName == "PasteFromWord"
|| commandName == "PasteFromWordNoFontsNoSizes"
|| commandName == "PastePlainText"
|| commandName == "PasteAsHtml"
|| commandName == "Paste") {
var textLength = CalculateLength(editor, value);
var updatelimitCharacters = lengthDifference + limitCharacters;
if (textLength > limitCharacters) {
args.set_cancel(true);
alert(messagePaste);
}
                        
        }
}
catch (e) { }
}

function EditorMaxLengthvalidation8000(editor, args) {
var limitCharacters = 8000;
EditorMaxLengthvalidation(editor, args, limitCharacters);
//Hide the tabbing
HideTabbingInEditor(editor);

}

function EditorMaxLengthvalidation(editor, args, limitCharacters) {
var rtfEditor = editor;
var currentMode = rtfEditor.get_mode();
rtfEditor.set_stripFormattingOptions(Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage | Telerik.Web.UI.StripFormattingOptions.MSWordNoMargins);
AttachHandlers(currentMode, rtfEditor, limitCharacters);
editor.get_contentArea().className = "fs-editor";
   
}

function HideTabbingInEditor(editor) {
editor.removeShortCut("InsertTab");
var buttonsHolder = $get(editor.get_id() + "Top"); //get a reference to the top toolbar zone of the editor
var buttons = buttonsHolder.getElementsByTagName("A"); //get a reference to all A elements on the toolbar and disable the tabbing trough them
for (var i = 0; i < buttons.length; i++) {
var a = buttons[i];
a.tabIndex = -1;
a.tabStop = false;
}
var element = editor.get_element();
editor.get_contentAreaElement().tabIndex = element.tabIndex;
element.tabIndex = -1;
}


Afroz khan
Top achievements
Rank 1
 answered on 27 Mar 2015
1 answer
113 views
Hello,

Can somebody help me with my simple problem?

We have TreeView control on our page and it uses
XML file for data source. However, on NavigateURL when we use 3rd party site
with multiple parameters (query string), the XML will have an error after the
"&" from query string, is there any way we can correct this?

XML File Content:

<?xml version="1.0" encoding="utf-8" ?>
<Tree>
  <Node DragEnabled="false" 
        Text="Bankruptcy Pleadings and Motions Library" 
        EditEnabled="False" Value="0" 
        Category="Items" 
        Image="Images/Menu/arrowright.png" 
        Expanded="true" 
        NavigateUrl="https://app.abc.com/embed_widget/s/abc123?view=list&sort=name&direction=ASC&theme=blue" 
        Target="contentFrame" 
        ContextMenuName="BPML">
  </Node>
</Tree>


Thanks,

Renan

 
Ivan Danchev
Telerik team
 answered on 27 Mar 2015
5 answers
105 views
Hello Telerik Team,

I have a custom progress area built using the RadProgressArea to depict to the user the percentage of the process when they are sending a request. I would like to know if it is possible to stop the progression of the progress area when the cancel button was clicked. I have been trying multiple solutions, I have injected a javascript that will stop the postback of the request but the progress still continues. Do you have any solutions on this? Thanks! :)
Hristo Valyavicharski
Telerik team
 answered on 27 Mar 2015
4 answers
91 views
I have a RadGrid with hierarchy, and each DetailTable is always editable.  I'm looking for a way to have the group of input controls in the DetailTable (that have been dynamically added to a TextBoxSetting's TargetControls) to be validated in groups. The issue is that if a input in any DetailTable is in an error state, I can't update any of the DetailTables.  I've attempted using Validation Groups, but setting them in the ItemDataBound event is much too late in the page event cycle. 

In this example, I have a list of contacts in my MasterTableView. In the DetailTables, there are inputs that have been dynamically added to the RadInputManager. Can anyone think of a way to allow one DetailTable to be updated (using the btnSubmit button) when another DetailTable has an input that is in an error state?

<telerik:RadInputManager ID="inputManager" runat="server">       
    <telerik:TextBoxSetting BehaviorID="txt" Validation-IsRequired="true" />
</telerik:RadInputManager>
     
<telerik:RadGrid ID="rgUsers" runat="server" AutoGenerateColumns="false">
    <MasterTableView Name="Users" DataKeyNames="ContactId" HierarchyLoadMode="Client">
        <Columns>
            <telerik:GridBoundColumn DataField="ContactId" HeaderText="ID" />
            <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" />
            <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" />
        </Columns>
        <ParentTableRelation>
            <telerik:GridRelationFields MasterKeyField="ContactId" DetailKeyField="ContactId" />               
        </ParentTableRelation>
        <DetailTables>
            <telerik:GridTableView Name="FieldLevelChanges" DataKeyNames="ContactId" CommandItemDisplay="Bottom">
                <CommandItemTemplate>
                    <asp:Button ID="btnSubmit" runat="server" Text="Update" CommandName="Update">
                    </asp:Button>
                </CommandItemTemplate>
                <Columns>
                    <rad:GridTemplateColumn HeaderText="Value">
                        <ItemTemplate>
                            <asp:TextBox ID="txtValue" runat="server" Text='<%#Eval("Value")%>' />
                        </ItemTemplate>  
                    </rad:GridTemplateColumn>
                </Columns>                  
            </telerik:GridTableView>                               
        </DetailTables>                   
    </MasterTableView>
</telerik:RadGrid>

Protected Sub rgUsers_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles rgUsers.ItemDataBound
    If TypeOf e.Item Is GridDataItem And e.Item.OwnerTableView.Name = "FieldLevelChanges" Then
        Dim txtValue As TextBox = DirectCast(e.Item.FindControl("txtValue"), TextBox)
        inputManager.GetSettingByBehaviorID("txt").TargetControls.Add(New TargetInput(txtValue.UniqueID, True))
    End If
End Sub





Andy
Top achievements
Rank 2
 answered on 27 Mar 2015
9 answers
233 views
Hi all,
in my radscheduler instance I've a validator on subject field

This is the code

protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
 if ((e.Container.Mode == SchedulerFormMode.AdvancedEdit) || (e.Container.Mode == SchedulerFormMode.AdvancedInsert))
            {
                CustomValidator validatorForFilm1 = new CustomValidator();
                RadScheduler scheduler = (RadScheduler)sender;               
                validatorForFilm1.ValidationGroup = scheduler.ValidationGroup;
                validatorForFilm1.ControlToValidate = "Subject";
                validatorForFilm1.ErrorMessage = "Error";
                validatorForFilm1.ClientValidationFunction = "validationFunctionSubject";
                (e.Container.FindControl("Subject") as RadTextBox).Parent.Controls.Add(validatorForFilm1);
                //e.Container.Controls.Add(validatorForFilm1);
            }
}


and the javascript part

function validationFunctionSubject(source, arguments) {
            if (arguments.Value.length > 0)
            {
                arguments.IsValid = true;
            }
            else
            {
                arguments.IsValid = false;               
            }
        }


The validator is working because when i click on "Save" button the appointment is not saved, but no error message is showing.
I've hide some component of the advanced form in this way

function OnClientFormCreated(sender, eventArgs) {
                $telerik.$(".rsRecurrenceOptionList").children().each(function (i) {
                if (i < 1 || i >= 2)
                $(this).hide();
                });
          
                $telerik.$(".rsRecurrenceOptionList li:eq(1) input").attr("checked", "checked");
                $telerik.$(".rsRecurrenceOptionList li:eq(1) input").click();         
               
                $telerik.$(".rsAdvRecurrenceRangePanel li:eq(0)").hide();
                $telerik.$(".rsAdvRecurrenceRangePanel li:eq(1) span input").attr("checked", "checked");
 
                $telerik.$(".rsAdvDaily li:eq(1)").hide();
                $telerik.$(".rsAdvRecurrenceRangePanel li:eq(1)").hide();
 
                $telerik.$(".rsAdvRecurrenceRangePanel li:eq(2) input").attr("checked", "checked");
                //$telerik.$(".rsAdvRecurrenceRangePanel li:eq(2) input").click();
 
                $telerik.$(".rsAdvOptionsPanel li:eq(1)").hide();
                $telerik.$(".rsAdvOptionsPanel li:eq(2)").hide();           
        }

and

.rsAdvRecurrencePatterns
{
   visibility : hidden !important;
   height: 0px;
}

Could it be the cause? I've tried to remove all this code and nothing changed..
Any help on this?
Thanks a lot

N.
Ivan Danchev
Telerik team
 answered on 27 Mar 2015
2 answers
88 views
HI Telerik

I have a radgrid and in EditFormSettings template of this grid I have a UserControl. This usercontrol contains a radbutton which has its own css defined in the control's ascx file. 

But when I look into the generated html it shows a class Which is added to this radbutton and this is:

.RadGrid_SkinName input
{
   
}

This class is making the button look wierd. Is there a way to remove this class from the button's style.

Thank a lot.
Danail Vasilev
Telerik team
 answered on 27 Mar 2015
1 answer
357 views
Hi,
I have a column called "CauseCode" in a grid. This column has the values like O0205,L1307,etc in each rows. Each CauseCode has corresponding descriptions like
O - Description 1(from a table in database) - Segment
02-Description 2 (from a table in database) - Subgroup
05-Description 3(from a table in database) - cause

I am not displaying these descriptions in the grid but I am getting the values and hiding them. And now when I mouse hover the CauseCode column, it should display the corresponding descriptions in a tooltip dynamically.

In the below code, the tool tip should be displayed for the column "CauseCode" but I am getting its description values like Segment, Subgroup and cause and hiding them by making their display value as false.

 Please help in this regard.
 
Please find below for the code used.

<telerik:GridBoundColumn DataField="CauseCode"
FilterControlAltText="Filter CauseCode column" HeaderText="Cause Code" UniqueName="CauseCode" Display="true" FilterControlWidth="40px">
<HeaderStyle Width="80px" />

</telerik:GridBoundColumn>


<telerik:GridBoundColumn
DataField="MissOppSegmentDesc" HeaderText="Segment Description"
UniqueName="MissOppSegmentDesc"
Visible="true" Display="false">
<HeaderStyle Width="80px" />
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
DataField="MissOppSubgroupDesc" HeaderText="Subgroup Description"
UniqueName="MissOppSubgroupDesc"
Visible="true" Display="false" >
<HeaderStyle Width="80px" />
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
DataField="MissOppCauseDesc" HeaderText="Cause Description"
UniqueName="MissOppCauseDesc"
Visible="true" Display="false">
<HeaderStyle Width="80px" />
</telerik:GridBoundColumn>
Marin Bratanov
Telerik team
 answered on 27 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?