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

Insert not working inside RadAjaxPanel

7 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rabeeh
Top achievements
Rank 2
Rabeeh asked on 19 Sep 2010, 02:53 PM
   
I have a grid that is working fine, the problem is, when I put it inside RadAjaxPanel, I click 
add new record, the insert open successfully, I enter the values and click insert the RadGrid_InsertCommand
does not get invoked, and the grid shows empty again...

When I remove it from RadAjaxPanel it works normally..

Any pointers to this behavior ??
 


<
telerik:radgrid ID="radgrid_Languages"  runat="server" Skin="Office2007"
            GridLines="None" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
            Width="97%" OnNeedDataSource="RadGrid_NeedDataSource"
            OnDeleteCommand="RadGrid_DeleteCommand"
            OnInsertCommand="RadGrid_InsertCommand"
            OnUpdateCommand="RadGrid_UpdateCommand" EnableAJAX="True" 
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle
                
            <MasterTableView DataKeyNames="ID" GridLines="None" Width="100%" CommandItemDisplay ="Top"
                
<CommandItemSettings ExportToPdfText="Export to Pdf" AddNewRecordText="Add new language"></CommandItemSettings>
                
                <Columns
                    <telerik:GridEditCommandColumn
                    </telerik:GridEditCommandColumn
                    <telerik:GridDropDownColumn DataField="LanguageID" DataSourceID="lds_Languages"
                        HeaderText="Language" ListTextField="LanguageName" ListValueField="ID"
                        UniqueName="LanguageID">
                    </telerik:GridDropDownColumn>
 
                   <telerik:GridDropDownColumn DataField="ReadLevelID" DataSourceID="lds_ProficiencyLevels"
                        HeaderText="Read" ListTextField="LevelName" ListValueField="ID"
                        UniqueName="ReadLevelID">
                    </telerik:GridDropDownColumn>
 
                    <telerik:GridDropDownColumn DataField="WriteLevelID" DataSourceID="lds_ProficiencyLevels"
                        HeaderText="Written" ListTextField="LevelName" ListValueField="ID"
                        UniqueName="WriteLevelID">
                    </telerik:GridDropDownColumn>
 
                    <telerik:GridDropDownColumn DataField="SpeakLevelID" DataSourceID="lds_ProficiencyLevels"
                        HeaderText="Spoken" ListTextField="LevelName" ListValueField="ID"
                        UniqueName="SpeakLevelID">
                    </telerik:GridDropDownColumn>
 
                    
                    <telerik:GridButtonColumn CommandName="Delete" Text="Delete"
                        UniqueName="Delete" ConfirmText="Are you sure you want to delete ?"
                        ConfirmTitle="Alert">  
                    </telerik:GridButtonColumn
                </Columns
                      <EditFormSettings>
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
 
                            <FormStyle BackColor="#EEF2EA" Width="100%"></FormStyle>
 
                            <FormTableStyle CellPadding="2" CellSpacing="0"></FormTableStyle>
 
                            <FormTableItemStyle Height="29px" Width="100%"></FormTableItemStyle>
                        </EditFormSettings>
 
                <ExpandCollapseColumn Visible="False">  
                    <HeaderStyle Width="19px"></HeaderStyle
                </ExpandCollapseColumn
 
                   <NoRecordsTemplate>
                            <table style="width: 100%;height:100px">
                                <tr>
                                    <td>
                                        Please add your languages proficiency<br />
                                        <br />
                                        (Indicate Very Good , Good , Average , Weak )
                                    </td>
                                </tr>
                            </table>
                        </NoRecordsTemplate>
 
                <RowIndicatorColumn Visible="False">  
                    <HeaderStyle Width="20px" /> 
                </RowIndicatorColumn
            </MasterTableView
        </telerik:radgrid>

7 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 21 Sep 2010, 10:21 AM
Hi Rabeeh ,

The RadGrid control is properly configured. However can you share the full page code plus the code behind file for further research?

Also, please check any javascript errors are thrown on the page.

Kind regards,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rabeeh
Top achievements
Rank 2
answered on 22 Sep 2010, 08:32 AM
In the code behind, the grid is binded to a data table stored in session. This grid is located in a web control, and this web control is located in Rad Tab control in another page. there is Rad Script manager and style sheet manager on this page...

 
0
Rabeeh
Top achievements
Rank 2
answered on 26 Sep 2010, 07:22 PM

I created another example where I put only one grid and bind it to Linq data source, I enable automatic CRUD commands on grid and data source, I enable ajax, each time I add record it does not add, and it does not update, I remove ajax and all works fine, here is the a sample of the code, I refereed to any entity in linq context.

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
            </telerik:RadScriptManager>
 <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" Runat="server">
 
</telerik:RadStyleSheetManager>
<telerik:RadFormDecorator ID="RadFormDecorator1" Runat="server"
    Skin="Windows7" />
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="False">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="grid_Languages">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grid_Languages" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<fieldset style="width: auto">
    <legend>data</legend>
    <br />
    <br />
    <br />
    <table>
       
        <tr>
            <td>
                <fieldset style="width: 800px">
                    <legend>Languages</legend>
 
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
 
                    <telerik:RadGrid ID="grid_Languages" runat="server" Skin="Office2007" AllowFilteringByColumn="True"
                        AllowPaging="True" AllowSorting="True" AutoGenerateEditColumn="True" DataSourceID="lds_Languages"
                        GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
                        <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="lds_Languages"
                            CommandItemDisplay="TopAndBottom">
                            <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                            <RowIndicatorColumn>
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn>
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" ReadOnly="True"
                                    SortExpression="ID" UniqueName="ID">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="LanguageName" HeaderText="LanguageName" SortExpression="LanguageName"
                                    UniqueName="LanguageName">
                                </telerik:GridBoundColumn>
                                <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="Delete"
                                    ConfirmText="Are you sure you want to delete ?" ConfirmTitle="Alert">
                                </telerik:GridButtonColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </fieldset>
                <br />
                <br />
                <br />
            </td>
        </tr>
  
        <tr>
            <td>
            </td>
        </tr>
    </table>
</fieldset>
  
<asp:LinqDataSource ID="lds_Languages" runat="server" ContextTypeName="FDataDataContext"
    EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="Languages">
</asp:LinqDataSource>
0
Iana Tsolova
Telerik team
answered on 27 Sep 2010, 09:30 AM
Hello Rabeeh ,

I can see that you are ajaxifying the grid with the RadAjaxManager control but you have one additional RadAjaxPanel around the grid. Can you see if removing the odd RadAjaxPanel makes any difference?

All the best,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rabeeh
Top achievements
Rank 2
answered on 27 Sep 2010, 12:59 PM
Can you direct me to tutorial or supply an example that explains how to ajaxify a telerik RadGrid.
0
Iana Tsolova
Telerik team
answered on 28 Sep 2010, 11:17 AM
Hello Rabeeh ,

Find the below article elaborating on ajaxifying RadGrid:

http://www.telerik.com/help/aspnet-ajax/grdworkingwiththeajaxmode.html

Additionally, I suggest that you check out this help topic as well:

http://www.telerik.com/help/aspnet-ajax/ajxcontrolsinajaxpanelandajaxsettings.html

Best wishes,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rabeeh
Top achievements
Rank 2
answered on 28 Sep 2010, 01:13 PM
Thank you Lana
Tags
Grid
Asked by
Rabeeh
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
Rabeeh
Top achievements
Rank 2
Share this question
or