Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
128 views
I've recently discovered an issue that has come up on all of our projects that use the Editor.  For some reason, at first load of an editor, there is <br> tag just sitting in the HTML view.  This becomes an issue when dealing with required field validation.  I've tried to uncover where this is coming from by looking at your examples, but the only Editor I could find on there with no content was calling in the Skin "BasicSetOfTools."  As far as I'm aware this was not an issue until we started using the AJAX version of the tools.  I'm attaching our typical Editor code, hopefully this is a simple property that I need to set to stop the stupid br tag from getting inserted at initial load.
<telerik:RadEditor runat="server" SkinID="SettingProperties" ID="uxStoryHTML"> 
</telerik:RadEditor> 
 

Skin file:
<telerik:RadEditor runat="server" SkinID="SettingProperties" ContentFilters="MakeUrlsAbsolute" StripFormattingOptions="All"> 
    <DocumentManager SearchPatterns="*.doc,*.docx,*.pdf,*.xls,*.xlsx" DeletePaths="~/uploads/docs/" UploadPaths="~/uploads/docs/" ViewPaths="~/uploads/docs/" MaxUploadFileSize="10240000" /> 
    <ImageManager ImageEditorFileSuffix="*.gif,*.jpg,*.jpeg,*.png,*.bmp" DeletePaths="~/uploads/images/" UploadPaths="~/uploads/images/" ViewPaths="~/uploads/images/" MaxUploadFileSize="604800" /> 
    <MediaManager SearchPatterns="*.avi,*.mpeg,*.mp3,*.wma,*.wav,*.wmv,*.mpg,*.mov" DeletePaths="~/uploads/videos/" UploadPaths="~/uploads/videos/" ViewPaths="~/uploads/videos/" MaxUploadFileSize="5242880" /> 
    <FlashManager SearchPatterns="*.flv,*.swf" DeletePaths="~/uploads/flash/" UploadPaths="~/uploads/flash/" ViewPaths="~/uploads/flash/" MaxUploadFileSize="1024000"/> 
    <TemplateManager SearchPatterns="*.htm,*.html" /> 
    <CssFiles> 
        <telerik:EditorCssFile Value="~/CSS/cms.css" /> 
    </CssFiles> 
    <Tools> 
        <telerik:EditorToolGroup> 
            <telerik:EditorTool Name="AjaxSpellCheck" /> 
            <telerik:EditorTool Name="FindAndReplace" /> 
            <telerik:EditorTool Name="Copy" /> 
            <telerik:EditorTool Name="Paste" /> 
            <telerik:EditorTool Name="PasteFromWord" /> 
            <telerik:EditorTool Name="PasteFromWordNoFontsNoSizes" /> 
            <telerik:EditorTool Name="PastePlainText" /> 
            <telerik:EditorTool Name="PasteAsHtml" /> 
            <telerik:EditorTool Name="Undo" /> 
            <telerik:EditorTool Name="Redo" /> 
            <telerik:EditorSeparator Visible="true" /> 
            <telerik:EditorTool Name="ImageManager" /> 
            <telerik:EditorTool Name="DocumentManager" /> 
            <telerik:EditorTool Name="LinkManager" /> 
            <telerik:EditorTool Name="Unlink" /> 
        </telerik:EditorToolGroup> 
        <telerik:EditorToolGroup> 
            <telerik:EditorTool Name="JustifyLeft" /> 
            <telerik:EditorTool Name="JustifyCenter" /> 
            <telerik:EditorTool Name="JustifyRight" /> 
            <telerik:EditorTool Name="JustifyFull" /> 
            <telerik:EditorTool Name="JustifyNone" /> 
            <telerik:EditorSeparator Visible="true" /> 
            <telerik:EditorTool Name="Indent" /> 
            <telerik:EditorTool Name="Outdent" /> 
            <telerik:EditorTool Name="InsertOrderedList" /> 
            <telerik:EditorTool Name="InsertUnorderedList" /> 
            <telerik:EditorSeparator Visible="true" /> 
            <telerik:EditorTool Name="ConvertToLower" /> 
            <telerik:EditorTool Name="ConvertToUpper" /> 
            <telerik:EditorSeparator Visible="true" /> 
            <telerik:EditorTool Name="InsertTable" /> 
            <telerik:EditorTool Name="InsertSymbol" /> 
        </telerik:EditorToolGroup> 
        <telerik:EditorToolGroup> 
            <telerik:EditorTool Name="FormatStripper" /> 
            <telerik:EditorTool Name="FormatBlock" /> 
            <telerik:EditorTool Name="ApplyClass" /> 
            <telerik:EditorTool Name="Print" /> 
            <telerik:EditorTool Name="Superscript" /> 
            <telerik:EditorTool Name="Subscript" /> 
            <telerik:EditorTool Name="InsertParagraph" /> 
            <telerik:EditorTool Name="InsertHorizontalRule" /> 
            <telerik:EditorTool Name="InsertDate" /> 
            <telerik:EditorTool Name="InsertTime" /> 
            <telerik:EditorTool Name="AboutDialog" /> 
            <telerik:EditorTool Name="Help" /> 
        </telerik:EditorToolGroup> 
    </Tools> 
    <Modules> 
        <telerik:EditorModule Name="RadEditorStatistics" /> 
        <telerik:EditorModule Name="RadEditorDomInspector" /> 
        <telerik:EditorModule Name="RadEditorNodeInspector" /> 
    </Modules> 
</telerik:RadEditor> 

Dobromir
Telerik team
 answered on 05 Feb 2010
1 answer
251 views
Hi
      I just upgraded to this ajax version .I am facing some difficulties in radwindow and radwindowmanager.What is the replacement of  ClientCallBackFunction in radwindowmanager and radwindow..
Svetlina Anati
Telerik team
 answered on 05 Feb 2010
1 answer
133 views
Hi,

I want to insert/update appointements in a customize template.

I have created an inline template and add somme new attributes like this :
<InlineInsertTemplate> 
       <div id="InlineInsertTemplate"> 
                 <table> 
                    [... Other code with date and event's description ...] 
                        <tr id="quid"> 
                                <td> 
                                    <asp:Label ID="lbl_quid_advanced_insertion" runat="server" Text="Civ, Nom, Prénom : "></asp:Label> 
                                </td> 
                                <td style="width:auto;">      
                                    <asp:DropDownList ID="ddl_civilite" runat="server"> 
                                        <asp:ListItem>Mlle</asp:ListItem> 
                                        <asp:ListItem>Madame</asp:ListItem> 
                                        <asp:ListItem>Monsieur</asp:ListItem> 
                                    </asp:DropDownList> 
                                </td> 
                                <td>      
                                    <asp:TextBox ID="TxtNomComplet" runat="server"></asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr id="identifiant"> 
                                <td> 
                                    <asp:Label ID="lbl_identifiant_advanced_insertion" runat="server" Text="Identifiant (ex : Carte de fidélité) : "></asp:Label> 
                                </td> 
                                <td>      
                                    <asp:TextBox ID="txt_identifiant_advanced_insertion" runat="server"></asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr id="tel1"> 
                                <td> 
                                    <asp:Label ID="lbl_tel1_advanced_insertion" runat="server" Text="Tel 1 : "></asp:Label> 
                                </td> 
                                <td>      
                                    <asp:TextBox ID="txt_tel1_advanced_insertion" runat="server"></asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr id="tel2"> 
                                <td> 
                                    <asp:Label ID="lbl_tel2_advanced_insertion" runat="server" Text="Tel 2 : "></asp:Label> 
                                </td> 
                                <td>      
                                    <asp:TextBox ID="txt_tel2_advanced_insertion" runat="server"></asp:TextBox> 
                                </td> 
                            </tr> 
                        </table> 
                    </div> 
</InlineInsertTemplate> 

With the rad scheduler i use methods to insert/update datas :
OnAppointmentInsert="RadScheduler1_AppointmentInsert" 
OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" 
 

In the code behind i want to recup datas from the customize template to insert them in my database i do this :
 protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) 
    { 
        Event monevenement = new Event(); 
         
       Event.InsertEvent(1, "testinsertnom", DateTime.Now, DateTime.Now, "testinsertmotif", TxtNomComplet ... others variables); 
 
    } 

And i can't find a way to get the value of my TxtBox here...

Do you know how could i get this information???

Thanks for helping.





Peter
Telerik team
 answered on 05 Feb 2010
11 answers
409 views
I am attempting to create a tooltip for items in a repeater control.  I bind the repeater control to a datatable, and in the ItemDataBound event I add an attribute to a label control within the repeater to execute a javascript function showToolTip for the onmouseover event.

This is my javascript function:
        function showToolTip(element) { 
            var tooltipManager = $find("<%= RadToolTipManager1.ClientID %>"); 
             
            if (!tooltipManager) return; 
             
            var tooltip = tooltipManager.getToolTipByElement(element); 
             
            if (!tooltip) { 
                tooltip = tooltipManager.createToolTip(element); 
                var partNo = element.innerHTML; 
                tooltip.set_value(partNo); 
            } 
             
            element.onmouseover = null; 
             
            try { 
                tooltip.show(); 
            } 
            catch(ex) { 
                alert(ex.description); 
            } 
        } 
 

Here is my toolmanager:
        <telerik:RadToolTipManager  ID="RadToolTipManager1" runat="server"  
                AutoCloseDelay="10000" Width="160px" Height="70px" 
                RelativeTo="Element"  
                Position="MiddleRight" Skin="Outlook"> 
            <WebServiceSettings Path="GetPartToolTip.asmx" Method="GetPartInfo" /> 
            <TargetControls> 
                <telerik:ToolTipTargetControl IsClientID="false" TargetControlID="txtFakeTooltip" Value="" /> 
            </TargetControls> 
        </telerik:RadToolTipManager> 
 

Here is the code for the webservice:
Imports System.Web 
Imports System.Web.Services 
Imports System.Web.Services.Protocols 
Imports System.ComponentModel 
Imports System.Web.UI 
Imports System.Web.UI.WebControls 
Imports System.Reflection 
Imports System.IO 
Imports System.Collections 
 
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
' <System.Web.Script.Services.ScriptService()> _ 
<WebService(Namespace:="http://tempuri.org/")> _ 
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ 
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ 
Public Class GetPartToolTip 
     Inherits System.Web.Services.WebService 
 
    <WebMethod()> _ 
    Public Function GetPartInfo(ByVal context As String) As String 
 
        Try 
            'Return "Hello" 
            'Dim contextDictionary As IDictionary(Of String, Object) = CType(context, IDictionary(Of String, Object)) 
            'Dim elementID As String = CType(contextDictionary("Value"), String) 
 
            If String.IsNullOrEmpty(context) Then 
                Throw New Exception("No Value argument is provided to the webservice!") 
            End If 
 
            Return ViewManager.RenderView("part_availability.ascx", context) 
        Catch ex As Exception 
            Return "Error occurred in GetPartInfo. Error: " & ex.Message 
        End Try 
    End Function 
 
End Class 
 
Public Class ViewManager 
 
    Public Shared Function RenderView(ByVal path As String, ByVal partno As String) As String 
        Dim pageHolder As Page = New Page 
        Dim viewControl As UserControl = CType(pageHolder.LoadControl(path), UserControl) 
 
        Dim viewControlType As Type = viewControl.GetType 
 
        Dim partNbr As FieldInfo = viewControlType.GetField("partno") 
        If Not partNbr Is Nothing Then 
            partNbr.SetValue(viewControl, partno) 
        Else 
            Throw New Exception("View file: " & path & " does not have a public 'partno' property") 
        End If 
 
        pageHolder.Controls.Add(viewControl) 
        Dim output As StringWriter = New StringWriter 
        HttpContext.Current.Server.Execute(pageHolder, output, False) 
 
        Return output.ToString 
    End Function 
 
End Class 

I added this web service to my web site solution and the code source was stored in the App_Code folder.  I then created a web reference to this web service in my solution.  If I call the Web Service directly, I get a good return string back, but when I call it from within the web application, a pop-up appears stating 'The server method 'GetPartInfo' failed.' 

Any help on this will be greatly appreciated.

Thanks!





Svetlina Anati
Telerik team
 answered on 05 Feb 2010
1 answer
125 views
Hi,

      Right now I am replacing the old telerik control with new telerik control. In the old code,
     
var newItem = new RadMenuItem(); 

      After replacing with new telerik control, the above code is not working in the Javascript. It is giving as undefined error.

Thanks,
Suresh
http://www.sureshdevi.co.in
Schlurk
Top achievements
Rank 2
 answered on 05 Feb 2010
9 answers
520 views
And by paragraph, I mean surround a block of text with a <p> tag.

I tried : the new paragraph tool and the formatblock tool.

Problem with the new paragraph tool : when hit, it erases the selected text (ok, it's "new" paragraph, no problem with that) but after hitting the button, the cursor is outside the paragaph. °_° ! That part looks quite strange for my end-users.

Problem with the formatblock tool : as long as it seems they is no solution with the "new paragraph" tool, I tried to use the formatblock. Our goal is to copy/paste big blocks of plain text, and format it. That part is a H2, that one is a H3 ... oh, and that one is P. So I configure my toolfile like this :

<paragraphs>
<paragraph name="Clear" value="&lt;body>" />
<paragraph name="&lt;p>Paragraphe&lt;/p>" value="&lt;P>" />
<paragraph name="SillyTag" value="&lt;SillyTag>" />
<paragraph name="&lt;H1>Heading 1&lt;/H1>" value="&lt;H1>" />
<paragraph name="&lt;H2 style='font-family: Trebuchet MS;'>Heading 2&lt;/H2>" value="&lt;H2 style='font-family: Trebuchet MS;'>" />
<paragraph name="&lt;H3 class='serif'>Heading 3&lt;/H3>" value="&lt;H3 class='serif'>" />
</paragraphs>

When I select text, and then choose the formatting, everything works fine ... except for the P :-/ If I choose "SillyTag", I got : <sillytag>some text </sillytag>. Why does the P tag have a peculiar behavior ? How can I surround the selected text with a P tag ?

I succeded having text surrounded by a P tag, but for that I select the text, choose H1, than choose P :-/

Thanks in advance for the answer.
Rumen
Telerik team
 answered on 05 Feb 2010
1 answer
125 views

Hi,

I am using rad grid version 4.6.0.0.  I am exporting data to excel using GridExcelExportFormat.Html  format. The data is in 99-9999 format.

 

 

 

The issue is while exporting it converts this numeric data into Date format. I need to preserve this number-number format while exporting also.

If anybody know how to preserve the data format pls let me know.

Thanks in advance

 

Daniel
Telerik team
 answered on 05 Feb 2010
2 answers
184 views
Hi all,

I'm working on this grid and the issue here is I don't know how many columns I'll need at runtime.  And each cell needs a textbox in it.  So I found this page (http://www.telerik.com/help/aspnet-ajax/grdputallitemsineditmodenoadditionalrebind.html) and thus was able to get all of the items in the grid to show as textboxes with their right data in them.  My plan was to put a save button on the form and when the user clicked save, to iterate through all the textboxes and save their values back to the database.  However, when the user clicks the save button (just a linkbutton that has an OnClick="lbSave_Onclick" and so it should go to that sub when it's clicked) -- when I click the save button I get an error.  I know it has something to do with all those grid cells being in edit mode because when I remove the databinding for the grid and then click the save button it goes straight to Save_Onclick routine.

Any ideas?  The error message I get is :
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Specified argument was out of the range of valid values.
Parameter name: index

and it's in telerik's webresource_2.axd file



Denise Duggan
Top achievements
Rank 1
 answered on 05 Feb 2010
3 answers
595 views
I may be just overlooking something in the examples but how do you programatically make a column in the grid be a drop down list when the datasource is a runtime only table.

What I want is a 2 column unbound grid with 20 rows and the first column is a drop down list with all of the field names from a sql table.
What I'm doing is creating a in memory datatable with 2 columns and 20 blank rows and making this the datasource for a RadGrid.
Then I want to make the first column of the grid be a drop down list with the fieldnames from an sql table.
The grid should start out in edit mode and then save the users entries for both columns in the underlying datatable so that I can loop through the datatable and use the fieldnames and value pairs for an update string.

This seems straight forward but I haven't been able to make it work yet.

Any help would be greatly appreciated.
Pavlina
Telerik team
 answered on 05 Feb 2010
1 answer
115 views
Hello, We have a project. Well, We have a Panel that is also an INamingContainer(a custom control derived from these). We then put inside of this Panel a RadGrid control and a Button control. Note, this is on an ASP.Net AJAX enabled page. As such, the buttons and such all post back async. Well, whenever I go `mygrid.AutoGenerateColumns=true` I suddenly no longer get the `mybutton.Click` event. It does postback and hits the ASP.Net server again, but it does not fire this event. Only whenever AutoGenerateColumns is enabled, that is.

The Grid is databound and is setup like this:
            _gridcontrol.Height = Unit.Pixel(200); 
            _gridcontrol.DataSource = _GridDataSet; 
            _gridcontrol.DataMember = "GRIDFORMDATA"; 
            _gridcontrol.Width = Unit.Percentage(100); 
            // _gridcontrol.AutoGenerateColumns = true; 
            _gridcontrol.AutoGenerateHierarchy = true; 
            _gridcontrol.Enabled = true; 
             
            _gridcontrol.ClientSettings.EnablePostBackOnRowClick = true; 
            _gridcontrol.ClientSettings.Selecting.AllowRowSelect = true; 
            _gridcontrol.SelectedIndexChanged += new EventHandler(_gridcontrol_SelectedIndexChanged); 

Note, I can use all of those lines for setup and it works, but when I uncomment AutoGenerateColumns, suddenly the events for everything inside of the Panel containing it cease to be fired.

The RadGrid control is the only Telerik control I am using also(no Telerik ajax or anything) and the Panel containing the RadGrid is contained inside of an UpdatePanel. Also, the RadGrid control is dynamically created at runtime.
Pavlina
Telerik team
 answered on 05 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?