Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
92 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
299 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
840 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
409 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
161 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
4 answers
189 views
hi,

I have a problem with binding data to a radgrid from client side!!!!
I have a WCFServiceLibrary where my service class and it's interface are in. In this service class I have defined the getAllPlaceDefinitions() method as follows :

public List<AccPlc> getAllPlaceDefinitions(int startIndex, int maxRowCount, int someParameter)
        {
            List<AccPlc> list = (from plc in Generals.DbList.AccPlcs
                                 select plc).ToList();

            return list;
        }


 In a WCFWebsite ,called http://localhost:11, I have defined my svc file(In folder BasicSetting). This file is called "PlacesDefinitionManager.svc".

In my ASP.Net website I used the radgrid, mastertable and I defined my columns in it.
Client Setting code is as follows :

<ClientSettings>
                        <DataBinding SelectMethod="getAllPlaceDefinitions"  Location="http://localhost:11/BasicSetting/PlacesDefinitionManager.svc"
                            EnableCaching="false">
                        </DataBinding>
                    </ClientSettings>

When I browse this page the grid brings some empty rows.:(  I think it doesn't find the svc file or cannot use it.
Would you please help me with my problem?!?!





Nikolay Rusev
Telerik team
 answered on 06 Aug 2009
1 answer
78 views
want to do sum of all the estimated cost but from code behind not using design time .  How to achieve this through code behind . I am trying to do this but it only the sum first five records in grid .


For Each ditim As GridDataItem In dgProposals.MasterTableView.Items
            Dim fieldValue As Double = CDbl(ditim("Estcost").Text.Substring(0))
            txtallproposal.Text = fieldValue + tm
            tm = txtallproposal.Text
        Next



Princy
Top achievements
Rank 2
 answered on 06 Aug 2009
1 answer
116 views
Is it possible to load a RadControl in a RadWindow?
Currently, I'm trying to load a radProgressArea into a
RadWindow as a modal so a user cannot navigate anywhere
else during upload process. Please let me know what you think.
Thank you
Georgi Tunev
Telerik team
 answered on 06 Aug 2009
1 answer
64 views
am i missing something or does the radwindowmanager dialog for creating windows not allow you to set multiple behaviours.


on the dialog you get a simple drop down that lets u select one behaviour but you cant pick multiple choices, in the source you have to enter "reload, resize" etc etc



thanks
kevin
Georgi Tunev
Telerik team
 answered on 06 Aug 2009
1 answer
118 views
Hello Sir

In my Radgrid one column contains date , i want to filter out the data yearly means if i enter the year 2008 then it will automatically search the record of year 2008.

and IInd is
In my Radgrid one column contains Cost , it contains the amount 3000.00 format ,, if i enter the value text format then it will give the error .. Is it possible to validate to users enters only Number format data .....


How to achieve this above two functionality ??


How to customize the Date  ? How to seach data yearly ?


Its urgent.....................................

Thanks
Regard
Rahul
Yavor
Telerik team
 answered on 06 Aug 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?