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

RadGrid UpdateCommand event does not get fired

2 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kamini
Top achievements
Rank 1
kamini asked on 30 Oct 2013, 12:10 PM
Hi

I am using telerik:GridEditCommandColumn to update records with telerik:RadAjaxManager but in this case UpdateCommand event does not get fired. When I remove telerik:RadAjaxManager, It is working properly.

aspx page
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
            </telerik:RadAjaxLoadingPanel>
            <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowAutomaticUpdates="true"
                BorderColor="#CCCCCC" OnNeedDataSource="RadGrid1_OnNeedDataSource" EnableAJAX="True"
                OnUpdateCommand="RadGrid1_UpdateCommand" OnItemDataBound="RadGrid1_OnItemDataBound"
                Skin="CustomSkin" EnableEmbeddedSkins="False">
                <HeaderStyle BorderColor="#CCCCCC" />
                <MasterTableView AllowPaging="True" DataKeyNames="UserId">
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                            <HeaderStyle Width="20px" />
                            <ItemStyle CssClass="editButton" />
                        </telerik:GridEditCommandColumn>
                                            <telerik:GridTemplateColumn HeaderText="Name">
                            <ItemTemplate>
                                <asp:Label ID="lblName" runat="server" Text='<%#Eval("Name") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtName" runat="server" MaxLength="50" CssClass="NormalTextBox"
                                    Width="150px" Text='<%#Eval("Name") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Email">
                            <ItemTemplate>
                                <asp:Label ID="lblEmail" runat="server" Text='<%#Eval("Email") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtEmail" runat="server" MaxLength="100" CssClass="NormalTextBox"
                                    Width="150px" Text='<%#Eval("Email") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Phone">
                            <ItemTemplate>
                                <asp:Label ID="lblPhone" runat="server" Text='<%#Eval("Phone") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <Portal:Telephone ID="uclPhone" runat="server" Width="150px" Telephone='<%#Eval("Phone") %>'>
                                </Portal:Telephone>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText= Date">
                            <ItemTemplate>
                                <asp:Label ID="lblDate" runat="server" Text='<%#Eval("Date") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadDatePicker ID="radDate" runat="server" Width="150px" SelectedDate='<%#Eval("Date") %>'
                                    Culture="English (United States)">
                                    <DateInput DateFormat="MM/dd/yyyy">
                                    </DateInput>
                                    <Calendar ShowRowHeaders="False" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                        ViewSelectorText="x">
                                    </Calendar>
                                </telerik:RadDatePicker>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

I don't want to remove telerik:RadAjaxManager. What could I do So that OnUpdateCommand event is able to get fired with telerik:RadAjaxManager?

Can anyone help me please..?

Thanks
Kamini

2 Answers, 1 is accepted

Sort by
0
kamini
Top achievements
Rank 1
answered on 31 Oct 2013, 11:43 AM
I also have tried to set EditMode="InPlace" and its working fine. What could be the issue with EditMode="EditForms"?
0
Princy
Top achievements
Rank 1
answered on 01 Nov 2013, 10:12 AM
Hi Kamini,

I tried your code and its working fine at my end. I have noticed that you have set AllowAutomaticUpdates="true", when you are performing Manual CRUD Operations we don't set properties such as AllowAutomaticUpdates, AllowAutomaticInserts and AllowAutomaticDeletes.
So please set it to false and see if it makes any difference.

Thanks,
Princy

Tags
Grid
Asked by
kamini
Top achievements
Rank 1
Answers by
kamini
Top achievements
Rank 1
Princy
Top achievements
Rank 1
Share this question
or