Telerik Forums
UI for ASP.NET AJAX Forum
12 answers
381 views

Hello,

Our online version of RadEditor is 7.3.2 – RadEditor for ASP .NET

While attempting to migrate to the RadEditor for ASP .NET AJAX we’ve came across these problems:

1.       We’re interested in having the editor strip HTML tags (except for BR tags) when the user pastes content into it. Since the stripping is problematic in FF, we’ve written some client code to bring the “paste plain text page” up when the user tries to paste. This is the code we have online:

function OnClientCommandExecuting(editor, commandName, oTool)          

{

    var browserName=navigator.appName;           

    if (commandName == "Paste" && browserName!="Microsoft Internet Explorer")          

    {      

        editor.Fire("PastePlainText");       

        return false;          

    }              

}

We’ve changed it to fit the new version thus:

function OnClientCommandExecuting(editor, commandName, oTool)          

{

    var browserName=navigator.appName;           

    if (commandName._commandName == 'Paste' && browserName!="Microsoft Internet Explorer")          

    {      

        editor.fire("PastePlainText");       

        return false;          

    }              

}

Which works, but the behavior is different! Instead of bringing up the “paste plain text page”, the editor first puts the clipboard’s content in the content-area of the editor, and only then brings the page up, thereby rendering our efforts useless.
Please advise as to what we can do to solve this problem ?

2.       Another problem is, when the user clicks the “paste” button, the “Please use Ctrl+V to Paste” msgbox appears before the “paste plain text page” appears.
How do we suppress this in the new (AJAX) version ?

Chase Florell
Top achievements
Rank 1
 answered on 09 Apr 2010
1 answer
82 views
Hi
I am using the Telerik controls under Mono and have a page with a grid. In the Q3/2009 version everything worked fine. With the Q1/2010 version I get a strange error.
Heres's the error message:

'GridDataTypeConverter' is unable to convert 'System.MonoType' to 'System.ComponentModel.Design.Serialization.InstanceDescriptor'.

Description: HTTP 500. Error processing request.

Stack Trace:

System.NotSupportedException: 'GridDataTypeConverter' is unable to convert 'System.MonoType' to 'System.ComponentModel.Design.Serialization.InstanceDescriptor'.
  at System.ComponentModel.TypeConverter.GetConvertToException (System.Object value, System.Type destinationType) [0x00000]
  at System.ComponentModel.TypeConverter.ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, System.Object value, System.Type destinationType) [0x00000]
  at Telerik.Web.UI.GridDataTypeConverter.ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, System.Object value, System.Type destinationType) [0x00000]
  at System.ComponentModel.TypeConverter.ConvertTo (System.Object value, System.Type destinationType) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.GetExpressionFromString (System.Type type, System.String str, System.Reflection.MemberInfo member) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.AddCodeForPropertyOrField (System.Web.UI.ControlBuilder builder, System.Type type, System.String var_name, System.String att, System.Reflection.MemberInfo member, Boolean isDataBound, Boolean isExpression) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.ProcessPropertiesAndFields (System.Web.UI.ControlBuilder builder, System.Reflection.MemberInfo member, System.String id, System.String attValue, System.String prefix) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.CreateAssignStatementFromAttribute (System.Web.UI.ControlBuilder builder, System.String id) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.CreateAssignStatementsFromAttributes (System.Web.UI.ControlBuilder builder) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.CreateControlTree (System.Web.UI.ControlBuilder builder, Boolean inTemplate, Boolean childrenAsProperties) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.CreateControlTree (System.Web.UI.ControlBuilder builder, Boolean inTemplate, Boolean childrenAsProperties) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.CreateControlTree (System.Web.UI.ControlBuilder builder, Boolean inTemplate, Boolean childrenAsProperties) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.CreateControlTree (System.Web.UI.ControlBuilder builder, Boolean inTemplate, Boolean childrenAsProperties) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.CreateControlTree (System.Web.UI.ControlBuilder builder, Boolean inTemplate, Boolean childrenAsProperties) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.CreateControlTree (System.Web.UI.ControlBuilder builder, Boolean inTemplate, Boolean childrenAsProperties) [0x00000]
  at System.Web.Compilation.TemplateControlCompiler.CreateMethods () [0x00000]
  at System.Web.Compilation.PageCompiler.CreateMethods () [0x00000]
  at System.Web.Compilation.BaseCompiler.ConstructType () [0x00000]
  at System.Web.Compilation.GenericBuildProvider`1[TParser].GenerateCode () [0x00000]
  at System.Web.Compilation.BuildManager+BuildItem.GenerateCode () [0x00000]

Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433

I use the Mono version 2.4.2.3. Are there any limitations for the new Telerikm version or do you have any suggestions what to do next?

Best regards.
Ferdinand
Daniel
Telerik team
 answered on 09 Apr 2010
2 answers
133 views
i have a grid as below:
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" Width="828px" OnNeedDataSource="RadGrid1_NeedDataSource" 
        OnUpdateCommand="RadGrid1_UpdateCommand" EnableAjaxSkinRendering="true" Skin="Default" 
        OnInsertCommand="RadGrid1_InsertCommand"> 
        <MasterTableView DataKeyNames="ProductID" GridLines="None" Width="100%" CommandItemDisplay="Top"> 
            <Columns> 
                <telerik:GridTemplateColumn HeaderText="Prod.Image" UniqueName="ProductImage"> 
                    <ItemTemplate> 
                        <asp:Image ID="Image1" ImageUrl='<%# Link.ToProductThumbNail(Eval("Thumbnail").ToString()) %>' 
                            runat="server" /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn HeaderText="Prod. Number" UniqueName="ProductNoImage"> 
                    <ItemTemplate> 
                        <asp:Image ID="Image2" ImageUrl='<%# Link.ToProductNo(Eval("ProductNo").ToString()) %>' 
                            runat="server" /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridBoundColumn DataField="Name" HeaderText="Prod.Name" UniqueName="ProdName"> 
                </telerik:GridBoundColumn> 
                <telerik:GridHTMLEditorColumn DataField="Description" HeaderText="Prod.Desc" UniqueName="ProdDescription"> 
                </telerik:GridHTMLEditorColumn> 
<%--                <telerik:GridBoundColumn DataField="Description" HeaderText="Prod.Desc" UniqueName="ProdDescription"> 
                </telerik:GridBoundColumn>--%> 
                <telerik:GridBoundColumn DataField="Price" HeaderText="Price" DataFormatString="{0:£0.00}" 
                    UniqueName="ProdPrice"> 
                </telerik:GridBoundColumn> 
                <telerik:GridTemplateColumn UniqueName="SelectProd"> 
                    <ItemTemplate> 
                        <asp:HyperLink ID="HyperLink1" runat="server" Text="Select" NavigateUrl='<%# "ProductDetail.aspx?CategoryID=" +  
                                                                                                      Request.QueryString["CategoryID"] +  
                                                                                                      "&amp;ProductIDProductID=" + Eval("ProductID") %>'> 
                        </asp:HyperLink> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridCheckBoxColumn Visible="false" DataField="PromoFront" HeaderText="Cat.Promo" 
                    UniqueName="PromoFront"> 
                </telerik:GridCheckBoxColumn> 
                <telerik:GridCheckBoxColumn Visible="false" DataField="PromoDept" HeaderText="Dept.Promo" 
                    UniqueName="PromoDept"> 
                </telerik:GridCheckBoxColumn> 
                <telerik:GridEditCommandColumn> 
                </telerik:GridEditCommandColumn> 
            </Columns> 
            <EditFormSettings ColumnNumber="2" CaptionFormatString="Edit details for:{0}" CaptionDataField="Name"> 
                <FormTableItemStyle Wrap="False"></FormTableItemStyle> 
                <FormCaptionStyle></FormCaptionStyle> 
                <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" /> 
                <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" Height="110px" 
                    Width="100%" /> 
                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> 
                <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle> 
                <EditColumn UpdateText="Update" UniqueName="EditCommandColumn1" CancelText="Cancel"> 
                </EditColumn> 
                <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> 
            </EditFormSettings> 
            <ExpandCollapseColumn Visible="False"> 
                <HeaderStyle Width="19px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <RowIndicatorColumn Visible="False"> 
                <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
        </MasterTableView> 
    </telerik:RadGrid> 
with the following code behind to save the data to the dabase:
protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) 
    { 
        //Get the GridEditableItem of the RadGrid      
        GridEditableItem editedItem = e.Item as GridEditableItem; 
         
 
        //Get the primary key value using the DataKeyValue.      
        string id = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ProductID"].ToString(); 
         
        //Access the textbox from the edit form template and store the values in string variables. 
        //string productno = (editedItem["ProductNo"].Controls[0] as TextBox).Text; 
        string name = (editedItem["ProdName"].Controls[0] as TextBox).Text; 
        string description = (editedItem["ProdDescription"].Controls[0] as GridHTMLEditorColumnEditor).Text; 
        string price = (editedItem["ProdPrice"].Controls[0] as TextBox).Text; 
        //string thumbnail = (editedItem["ProdThumbnail"].Controls[0] as TextBox).Text; 
        //string image = (editedItem["ProdImage"].Controls[0] as TextBox).Text; 
        string promoDept = (editedItem["PromoDept"].Controls[0] as CheckBox).Checked.ToString(); 
        string promoFront = (editedItem["PromoFront"].Controls[0] as CheckBox).Checked.ToString(); 
 
 
        try 
        { 
            CatalogAccess.UpdateProduct(id,name,description.ToString(),price,promoDept, promoFront); 
 
        } 
        catch (Exception ex) 
        { 
            RadGrid1.Controls.Add(new LiteralControl("Unable to update Category. Reason: " + ex.Message)); 
            e.Canceled = true; 
        } 
    } 
I keep getting the error on line 53
 Object reference not set to an instance of an object. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. 
 
Source Error: 
 
Line 51:         //string productno = (editedItem["ProductNo"].Controls[0] as TextBox).Text; 
Line 52:         string name = (editedItem["ProdName"].Controls[0] as TextBox).Text; 
Line 53:         string description = (editedItem["ProdDescription"].Controls[0] as GridHTMLEditorColumnEditor).Text; 
Line 54:         string price = (editedItem["ProdPrice"].Controls[0] as TextBox).Text; 
Line 55:         //string thumbnail = (editedItem["ProdThumbnail"].Controls[0] as TextBox).Text; 
I would really appreciate a solution.  I am sure I am almost there but not quite working.

Simon
Simon
Top achievements
Rank 1
 answered on 09 Apr 2010
9 answers
736 views
I'm struggling to find the right way to do this.

I have a user control with a RadGrid and an Edit button in it.  Clicking the Edit button retrieves the primary key for the selected row within the RadGrid and opens a RadWindow passing the primary key to the page opened in the window using a Query String.

Then I have a javascript routine that handles the Window close and does a Rebind on the RadGrid to refresh it with the latest values.  I use the argument from the Window to get the primary key again and select the corresponding row in the RadGrid.  This is done by calling 

var

ajaxManager = $find("<%= this.Page.AjaxManager.ClientID %>");
ajaxManager.ajaxRequestWithTarget('<%= Button_EditEntry.UniqueID %>', oWnd.argument);

The trouble is, this works fine within a page, but within a UserControl I seem to be faced with a dilema:

To retrieve the argument passed in the Ajax Request, I have to implement a RaisePostBackEvent method in my code-behind.  For a page, this is a simple matter of overriding the page's implementation of this.  For a UserControl, I have to implement IPostBackEventHandler.  According to the documentation, to ensure that my RaisePostBackEvent function gets called, I have to call ajaxRequestWithTarget using the UniqueID of the UserControl itself instead of the button, but if I do that, all the controls within the UserControl get updated during the Ajax Request instead of just those controls that Button_EditEntry should affect.

Within a UserControl, how can I initiate an Ajax call on the client side, retrieve the argument on the server side, and limit the controls that are updated to one or two instead of the entire UserControl?

Jeff

Rebecca Campbell
Top achievements
Rank 1
 answered on 09 Apr 2010
4 answers
131 views
Hello,

I have 2 RadTimePickers on an custom AdvancedEditTemplate for the Scheduler.
If I first click on the TimeInputButton and after that I do a Postback from inside the AdvancedEditTemplate, I can't click again on the TimeInputButton.
After some debugging, we found out that the _onTimePopupImageClickHandler handler is called twice. The first call succeeds, but the second one fails in getCorrectScrollLeft() from Telerik.Web.CommonScripts because A.document.documentElement is null.

Could you please provide a workaround or some advice for this? Is this a known issue?

Best regards,
Cantemir
Cantemir Mihu
Top achievements
Rank 1
 answered on 09 Apr 2010
3 answers
120 views

I have populated my rad combo box from database but i want to add a item named as "Select" as default to be shown initially after being populated.

Like if data from database if 1,2,3,4 then data should be displayed as select,1,2,3,4.

anyone help please.

k f
Top achievements
Rank 1
 answered on 09 Apr 2010
1 answer
163 views
Hi there,

Is there any way to add a new Dockzone to a docklayout (programmatically)? im designing a "form creator" where i will need users to add new columns to a form layout, therefore using the dockzone as a new column would be very useful.

thanks for your help
Pero
Telerik team
 answered on 09 Apr 2010
2 answers
182 views
Im trying the following, but it doesnt take.  How do I set the text for what is shown when there are no files to view in the FileExplorer?

RadFileExplorer1.Grid.MasterTableView.NoDetailRecordsText = "Upload files using right mouse click or the upload button."; 

Marc
Top achievements
Rank 1
 answered on 09 Apr 2010
4 answers
146 views
This combo doesn't work in Q1 2010, the FormDecorator applies skin to Fieldset.

The situation I have is asp:detailsview and RadListView in the same RadWindow.
FormDecorator messes up RadListView so I had set it to skip Fieldset and that works for Q3 2009 but Q1 2010 messes up either RadComboBox that is in the asp:detailsview or the RadListView.

Any hints on overcoming this limitation would be appriciated.
Using asp:dropdownlists instead of RadComboBoxes would ruin concistent look of the application.

Yours
   Björn
Andrey
Telerik team
 answered on 09 Apr 2010
5 answers
219 views
HI

I had to restore the toolbar in Visual Studio (right click, restore toolbar) and now when I add a telerik control to an exisitng page  I get a message saying " a file with the name bin/telerik.web.ui.dll already exists. Do you want to replace it?"

I am not sure whether I should say yes or no.  What is the issue here?

Thanks

Clive
version info Q2 2009
T. Tsonev
Telerik team
 answered on 09 Apr 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?