This is a migrated thread and some comments may be shown as answers.

Grid with Editor not saving values when embedded in RadAjaxManager

2 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 03 May 2012, 11:41 PM
I have a bit of a more complicated setup:

A usercontrol loading more usercontrols into a RadMultiPage. One of these usercontrols contains a Grid with Editors on there. Everything works fine, but when adding a RadAjaxManager + Loading Panel to the outer usercontrol (containing the RadMultiPage) - saving of the Grid doesn't have any effect, i.e. the value returned from the databound control is the same as the initial value - other columns in the grid do save, only the Editor doesn't.
When I change the Editor column to a regular TextBox column I can save again - but when trying to save some HTML code e.g. ">" "<" I get an exception in the Telerik Javascript.

I am assuming this behavior is due to the RadAjaxManager not liking the output of the Editor column (containing HTML) or something like that.

The outer containing usercontrol:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadMultiPage">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadTabStrip">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
<div class="right">
</div>
<div class="left">
            <telerik:RadTabStrip ID="RadTabStrip" SelectedIndex="0" runat="server" MultiPageID="RadMultiPage"
                CssClass="NoBg">
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage_PageViewCreated" />
</div>

The usercontrols for the RadMultiPage are loaded as shown here: http://demos.telerik.com/aspnet-classic/TabStrip/Examples/Application/AddDynamicUserControls/DefaultCS.aspx.

Lastly the usercontrol with the problem:
<telerik:RadGrid ID="radGrid1" runat="server" DataSourceID="dsMatrix" AutoGenerateColumns="False" Width="100%">
    <ClientSettings>
        <Selecting CellSelectionMode="None"></Selecting>
    </ClientSettings>
    <MasterTableView Width="100%" EditMode="InPlace" AllowAutomaticDeletes="True" AllowAutomaticUpdates="true" AllowAutomaticInserts="True" DataKeyNames="ID, RowVersion">
        <Columns>
            <telerik:GridBoundColumn DataField="ID" Visible="false" />
            <telerik:GridTemplateColumn DataField="Richtext" HeaderText="Richtext" HeaderStyle-Width="100%">
                <ItemTemplate>
                    <telerik:RadEditor ID="txtRichtext" Runat="server" EditModes="Design" ToolsFile="RadEditorBasic.xml" EnableResize="False" Content='<%# Bind("Richtext") %>' AutoResizeHeight="True" Height="100px" Width="100%" Enabled="False" ReadOnly="True" />
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadEditor ID="txtRichtext" Runat="server" EditModes="Design" ToolsFile="RadEditorBasic.xml" EnableResize="False" Content='<%# Bind("Richtext") %>' AutoResizeHeight="True" Height="100px" Width="100%" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" />
        </Columns>
        <EditFormSettings>
            <EditColumn ButtonType="ImageButton" ItemStyle-HorizontalAlign="Center"/>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

So again: When removing the RadAjaxManager from the container, the "Richtext" field is properly saved. When RadAjaxManager is present as shown above, the field is not saved at all. Any other type of field I add is saved properly.

Any suggestions to get this to work with still having the fancy "loading" animation instead of the full page postback?

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 08 May 2012, 05:33 PM
Hi Dennis,

Note that when the MultiPage is set as an updated control, you should also include the TabStrip associated with it in the Ajax settings. 
Can you modify your ajax settings as shown below and let us know if this helps?
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadTabStrip">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadTabStrip" />
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadMultiPage">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadTabStrip" />
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>


Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Dennis
Top achievements
Rank 1
answered on 14 May 2012, 03:28 PM
I uploaded a sample solution which shows the same problem (of course I added your suggestion to include RadTabStrip in the AjaxManager): I cannot save the RadGrid containing the RadEditors when AJAX is enabled, when I disable all AJAX saving is possible.

The table I'm using on the SQL Server is very simple:
USE [TestDB]
GO
SET ANSI_NULLS ON
GO
 
SET QUOTED_IDENTIFIER ON
GO
 
CREATE TABLE [dbo].[testTable](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [textProp] [nvarchar](50) NULL,
    [RadEditorText] [ntext] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
 
GO
Tags
Grid
Asked by
Dennis
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Dennis
Top achievements
Rank 1
Share this question
or