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

We are using RadEditor version 2009.2.701.35 (second quarter 2007).  We need to insure that the content returned by the RadEditor is XHTML compliant.  I have been investigating the RadEditor's support for XHTML compliance.  What I find is that if I switch to the HTML mode in the editor and directly type in non-XHTML-compliant markup and then switch back to the design mode, the RadEditor does a client-side fix of the non-compliant markup (for example, <u> goes to <span style="text-decoration: underline">, <br> goes to <br />, etc), which is great.

However, if I enter non-compliant markup in HTML mode and then remain in HTML mode, when I click a button to initiate a postback, I find that when look at the server-side RadEditor.Content property, I see my non-XHTML-compliant markup.  Thus the automatic conversion of non-XHTML-compliant markup to compliant markup only appears to occur if the user switches back to Design mode before posting back to the server.  If the user enters invalid markup in HTML mode and then submits, the invalid markup is passed to the server.

Are there any server-side properties on the RadEditor that I can access that are guarenteed to return XHTML-compliant content? I noticed that in the non-AJAX ASP.Net version of the RadEditor, there used to be an XHTML server-side property, but that has been replaced by the "Content" property.  However, the "Content" property does not appear to insure that only XHTML-compliant content is returned.

I would appreciate any suggestions you might have.

Thanks so much for the assistance.

Joe
Tervel
Telerik team
 answered on 06 Aug 2009
1 answer
110 views
I have a webform in asp.net 3.5 and VB and uses RadAjaxManager for updating the 
datatable/grid. Also uses impersonate in web.config.
 
I have a routine that loads a flat file into a datatable and checks 
for the existance of a notes file on our fileserver and then updates 
a datatable and grid if that file exists. Everything works fine when 
the page first loads and my routine (shown below) checks and finds 
the existance of the files and updates the datatable/grid correctly.
 
I also have a timer on the webform that checks the flat file for any 
changes. If the flat file is changed then it updates the datatable and 
checks for the existance of the notes files again by running the same 
routine that it runs when the page first loads. However, this time it 
does not find any files. The files are still there and the datatable/grid 
gets  updated correctly with any changes from the flat file. It is just 
that System.IO.FileInfo and Exists always returns false every time
after the first time the routine is run during the page load event.
The note files are still available when the timer executes the routine 
using AJAX but returns false. I can do a full refresh of the page and
the note files show up again.
...
Dim notesfile as String
notesfile = "\\hs_file\ROOT\SYS\HOME\" & username & "\NOTES\" & MeasureYears & "\" & sMeasureValue & ".doc"
Dim filenotes As New System.IO.FileInfo(notesfile)
If filenotes.Exists() Then
	row("NotesFileName") = notesfile
	row("Notes") = "Your Notes"
Else
	row("Notes") = Nothing
	row("NotesFileName") = Nothing
End If
...

Any help will be greatly appreciated. Thanks.

Jerry
 

Yavor
Telerik team
 answered on 06 Aug 2009
1 answer
184 views
Hi,

Is it possible to use your ModalOverlay which is used for modal radwindows within a aspx website?
I have a frameset like the following scheme:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Now I would like to disable e.g. the left and the top with your modaloverlay in some circumstances.
Maybe I can use some of your controls to achieve that?

Georgi Tunev
Telerik team
 answered on 06 Aug 2009
3 answers
223 views
Hi All,

How can i make a null item to represent null values for a combobox in a  formview?

in a details view it might look like this:

<

 

asp:TemplateField ConvertEmptyStringToNull="true" HeaderText="Currency"

 

 

SortExpression="currencyID">

 

 

<EditItemTemplate>

 

 

<asp:DropDownList ID="DdlCurrencyEdit" runat="server"

 

 

AppendDataBoundItems="true" DataSourceID="SqlDSCurrencies"

 

 

DataTextField="currencyName" DataValueField="currencyID"

 

 

SelectedValue='<%# Bind("currencyID") %>'>

 

 

<asp:ListItem Value="">(none)</asp:ListItem>

 

 

</asp:DropDownList>

 

 

</EditItemTemplate>

 



Can i add an empty list item in a similar way in design view for combobox? also.. is there a convertEmptyStringToNull equivalent in formsview (i know not telerik related..) thanks.
Veselin Vasilev
Telerik team
 answered on 06 Aug 2009
1 answer
155 views
I have a page based on the raddock example for storing raddock state into a database.
This has been working since Promethius but is raising an error "invalid argument" javascript exception at the line "_85.style.zIndex=this.originalZIndex;" every time I add a rad dock to the RadDockZone using the Q1 2009. 

I can't try q2 2009 because that is causing another error that I need to post.

Any help would be appreciated.

B


Pero
Telerik team
 answered on 06 Aug 2009
1 answer
85 views

I want to validate mossradeditor through javascript for required field validation.For this i need to read the content of editor in javascript but i unable get this(instance or object) control in javascript.

Is it possible to validate through javasrcipt? if yes,
Is there any way to get this control and content in javascript?


   I'm using this cotrol in custom webpart.
Please help me anyone!!!!
Stanimir
Telerik team
 answered on 06 Aug 2009
3 answers
287 views
Dear Support-Team,

I have the following issue:

I have downloaded the WebMail application and built a test website based on it. I just changes the contents of the panes but not the buildup of the application. I have a left pane on the left that contans a bottom pane (the links to contacts, notes, etc.) and on the right side, I have a right pane that stores emails, contacts, etc.

Please do the following with th demo application from your website:

View the WebMail in maximized window, then collapse the left pane, then minimize the webmail so that the browser window gets smaller than in maximized mode and then expand the left pane again. Now, the bottom left pane inside the left pane can't be seen, because its position has not been updated.

Vice versa:
If you star the webMail application not in maximized mode, then collapse the left pane and then maximize the browser window and then expand the left pane again, the bottom left pane inside the left pane will be on the original position, but not at the bottom (as it would be expected to be).

I have tested mny possible solutions, but I didn't get a result. So I would kindly like to ask you if you have a workaround for me or could help to solve this problem!

I am looking forward to hearing from you soon,
Marco
Svetlina Anati
Telerik team
 answered on 06 Aug 2009
4 answers
830 views
Hello, I am building the  onClick attribute of a HyperLink column within a RadGrid on the ItemCreated event, such as 

editLink.Attributes[

"onclick"] = "return ShowAttachForm();";

This calls a Javascript function to open a RadWindow.  I now need to pass parameters to the javascript function but I am having problems accessing the value of the other DataBoundGrid columns...it seems like the columns do not yet have a value.  How can I access the value of a column on the ItemCreated event of a RadGrid so I can do something like

 


editLink.Attributes[

"onclick"] = String.Format("return ShowAttachForm('{0}','{1}');", dataItem["JobNo"].Text, dataItem["ClientNo"].Text);

 



Thanks Kerry
Princy
Top achievements
Rank 2
 answered on 06 Aug 2009
3 answers
401 views
Hello, I'd like to trap the click event of a RadGrid column that is defined as asp:HyperLink.  I need to set some server-side variables before redirecting the user to another webpage.  THis was very easy when the column was a ButtonColumn but I had to change to a Hyperlink , I would trap the ItemCommand event then test the e.CommandName arguement then set my variables and redirect the user, but it seems the ItemCommand event is not fired when I click the hyperlink.

Thanks
Shinu
Top achievements
Rank 2
 answered on 06 Aug 2009
0 answers
156 views
Hello,

I am using a Editor control in that i want to do one functionality i.e when i select text from the editor & pressing on symbol button
 then i want to insert that symbol before & after  the selected text.

Here are Code that i USe

   <radE:RadEditor ID="txtExpressionText" Editable="true" EnableServerSideRendering="false"
                        EnableHtmlIndentation="false" ToolsFile="~/SurveyAnalysis/ToolsFile.xml" runat="server"
                        OnClientLoad="OnClientLoad" Width="100%"  Height="100px" onchange="UpdateDirtyFlag();">
                    </radE:RadEditor>

Button that inset  the symbol before & after the selected text

<asp:Button ID="btnPlus" OnClientClick="return GetContent('+ ');" UseSubmitBehavior="false"
                        runat="server" Text="+" />
Javascript
 function GetContent(Symbol)  
    {
 
        //Get a reference to the RadEditor  
        var editor = GetRadEditor("<%=txtExpressionText.ClientID%>");  
        var content = editor.GetHtml();  
        var text = editor.GetText();  
        var xxx=addSymbol(editor,Symbol);
        //document.getElementById('<%= hiddenName.ClientID %>').value=xxx;
        // update the dirty flag as the formula expression is modified
        UpdateDirtyFlag();
           return false;
    } 

function addSymbol(editor,Symbol) {
     var elementArray=Symbol.split(",");
     var ArrayLength=elementArray.length;
     if(ArrayLength==4)
     {
        if(elementArray[2]=='undefined')
        {
            alert("Please Select Element ");
            return;
        }
     }
     
  var formData = editor.GetSelection();
  formData=formData.GetText();
   if (formData == undefined) {
    /* This function is in TabbedApplicationPage.master and handles the prefixes */
      /* that can get applied to the IDs set in the source of the ASP page.        */
      var txtArea =editor.GetText();  
      var txtLength=txtArea.length;
      ctl00_contentPlaceHolder_txtExpressionText.SetFocus();
      var cursorpos = getCursorPos(editor);
     
      if(cursorpos==0)
      {
        cursorpos = GetPreviousCursorPosition();
            if(isNaN(cursorpos))
            {
                cursorpos=txtLength;
                alert("Please Select Cursor position");
                return;
            }
        if(cursorpos > txtLength || cursorpos==0 )
        {
            cursorpos=txtLength;
        }
      }
      SetPreviousCursorPosition(cursorpos + Symbol.length);
      var firstPart = txtArea.substring(0, cursorpos );
      var secondPart = txtArea.substring(cursorpos , txtLength);
      editor.SetHtml(firstPart + Symbol + secondPart);
      var text=editor.Html;
      editor.innerHTML = text;
      editor.SetFocus();
      return text;
      }
   else {
            var txtArea =editor.GetText();
            txtArea=txtArea.replace(formData,Symbol);
            editor.SetHtml(txtArea);
            editor.SetFocus();
            return txtArea;
      }
       editor.SetFocus();
   return false;
   }

function getCursorPos(textElement) {
 //save off the current value to restore it later,
 var sOldText =textElement.GetHtml(); //textElement.value;

//create a range object and save off it's text
 var objRange = document.selection.createRange();
 
 var sOldRange =objRange.text;

//set this string to a small string that will not normally be encountered
 var sWeirdString = '#%~';

//insert the weirdstring where the cursor is at
 objRange.text = sOldRange + sWeirdString;
 objRange.moveStart('character',(sOldRange.length - sWeirdString.length));//(0 - sOldRange.length - sWeirdString.length));

//save off the new string with the weirdstring in it
 var sNewText = textElement.GetHtml(); //textElement.value;

//set the actual text value back to how it was
 objRange.text = sOldRange;

//look through the new string we saved off and find the location of
//the weirdstring that was inserted and return that value
 for (i=0; i <= sNewText.length; i++) {
   var sTemp = sNewText.substring(i, i + sWeirdString.length);
   if (sTemp == sWeirdString) {
     var cursorPos = (i - sOldRange.length);
     return  cursorPos;
  }
   
 }
}


Here i provide all the code which i used in my application
I want to insert symbol before & after the selected text in editor. please provide the solution

Thanks,
Atul




   





Atul Deshmukh
Top achievements
Rank 1
 asked on 06 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?