Radgrid Insert/Update event not firing when multiple grid is in same page

1 posts, 0 answers
  1. Chockalingam
    Chockalingam avatar
    1 posts
    Member since:
    Sep 2013

    Posted 26 Sep 2013 Link to this post

    Hi,
    I am using multiple RadGrid in the same page, when AddNew in one grid is kept open, and then at the sametime AddNew in second grid is not working.

    Can anyone help me in solving this issue.

    asp Code:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="grdSoftware">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="grdSoftware" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="grdCategory">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="grdCategory" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
     </telerik:RadAjaxManager>
     
       <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue">
                </telerik:RadAjaxLoadingPanel>
     
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="980" ExpandMode="SingleExpandedItem" onclientitemcollapse="OnClientItemCollapse">
                    <CollapseAnimation Type="Linear" Duration="500" />
                    <Items>
    <telerik:RadPanelItem Expanded="false" Text="Software Description">
                            <ContentTemplate>
                                <telerik:RadGrid ID="grdSoftware" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
                                    AllowSorting="True" AutoGenerateColumns="False" AllowAutomaticUpdates="false"
                                    AutoGenerateDeleteColumn="True" AllowAutomaticInserts="false" ShowStatusBar="True"
                                    OnPreRender="grdSoftware_OnPreRender" OnItemDataBound="grdSoftware_ItemDataBound"
                                    OnItemCreated="grdSoftware_ItemCreated" OnItemCommand="grdSoftware_OnItemCommand"
                                    VirtualItemCount="50000" PageSize="5" GridLines="None" DataSourceID="dsSoftware"
                                    OnInsertCommand="grdSoftware_OnInsertCommand" OnUpdateCommand="grdSoftware_OnUpdateCommand"
                                    OnDeleteCommand="grdSoftware_OnDeleteCommand">
                                      <MasterTableView AllowMultiColumnSorting="true" CommandItemDisplay="Top" DataKeyNames="SofwareId"
                                        DataSourceID="dsSoftware">
                                        <CommandItemSettings ExportToPdfText="Export to Pdf" AddNewRecordText="Add New" AddNewRecordImageUrl="Images/AddNew.ico">
                                        </CommandItemSettings>
                                        <RowIndicatorColumn>
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Visible="true">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridEditCommandColumn />
                                            <telerik:GridBoundColumn DataField="SofwareId" DataType="System.Int32" HeaderText="SofwareId"
                                                ReadOnly="True" SortExpression="SofwareId" Visible="false" UniqueName="SofwareId">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="SoftwareName" HeaderText="SoftwareName" SortExpression="SoftwareName"
                                                UniqueName="SoftwareName">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" Visible="false"
                                                SortExpression="Description" UniqueName="Description">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridCheckBoxColumn DataField="IsActive" DataType="System.Boolean" HeaderText="IsActive"
                                                SortExpression="IsActive" UniqueName="IsActive">
                                            </telerik:GridCheckBoxColumn>
                                        </Columns>
              <EditFormSettings EditFormType="Template">
                                            <FormTemplate>
                                                <fieldset>
                                                    <table>
                                                        <tbody>
                                                            <tr>
                                                                <td>
                                                                    Software Name :
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtSoftwareName" Text='<%#Bind("SoftwareName") %>' runat="server"></asp:TextBox>
                                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="* Required"
                                                                        ControlToValidate="txtSoftwareName"></asp:RequiredFieldValidator>
                                                                </td>
                                                                <td>
                                                                </td>
                                                                <td>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Description :
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtDescription" Text='<%#Bind("Description") %>' runat="server"></asp:TextBox>
                                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="* Required"
                                                                        ControlToValidate="txtDescription"></asp:RequiredFieldValidator>
                                                                </td>
                                                                <td>
                                                                </td>
                                                                <td>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Is Active :
                                                                </td>
                                                                <td>
                                                                    <asp:CheckBox ID="chkIsActive" Checked='<%# Eval("IsActive") == DBNull.Value? true : Eval("IsActive") %>'
                                                                        runat="server"></asp:CheckBox>
                                                                </td>
                                                                <td>
                                                                </td>
                                                                <td>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                    <table style="width: 100%">
                                                        <tr>
                                                            <td align="right" colspan="2">
                                                                <asp:Button ID="Button1" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                                    runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                                                </asp:Button
                                                                <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                                                                </asp:Button>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </fieldset>
                                            </FormTemplate>
                                            <PopUpSettings Modal="true" Width="600" />
                                        </EditFormSettings>
                                        <PagerStyle AlwaysVisible="True" />
                                    </MasterTableView>
                                    <PagerStyle AlwaysVisible="True" />
                                </telerik:RadGrid>
                                <asp:SqlDataSource ID="dsSoftware" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
                                    SelectCommand="SELECT [SofwareId], [SoftwareName], [Description], [IsActive] FROM [SoftwareDetails]">
                                </asp:SqlDataSource>
                            </ContentTemplate>
                        </telerik:RadPanelItem>
     
     <telerik:RadPanelItem Expanded="false" Text="Exam Categories">
                            <ContentTemplate>
                                <telerik:RadGrid ID="grdCategory" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
                                    AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True"
                                    AllowAutomaticInserts="false" AllowAutomaticUpdates="false" ShowStatusBar="True"
                                    OnItemDataBound="grdCategory_OnItemDataBound" VirtualItemCount="50000" PageSize="5"
                                    OnItemCreated="grdCategory_ItemCreated" OnPreRender="grdCategory_OnPreRender"
                                    GridLines="None" DataSourceID="CategoryDatasource" OnInsertCommand="grdCategory_OnInsertCommand"
                                    OnUpdateCommand="grdCategory_OnUpdateCommand" OnDeleteCommand="grdCategory_OnDeleteCommand"
                                    OnItemCommand="grdCategory_OnItemCommand">
                                    <MasterTableView AllowMultiColumnSorting="true" CommandItemDisplay="Top" DataKeyNames="CategroyId"
                                        DataSourceID="CategoryDatasource">
                                        <CommandItemSettings ExportToPdfText="Export to Pdf" AddNewRecordText="Add New" AddNewRecordImageUrl="Images/AddNew.ico">
                                        </CommandItemSettings>
                                        <Columns>
                                            <telerik:GridEditCommandColumn />
                                            <telerik:GridBoundColumn DataField="CategroyId" DataType="System.Int32" HeaderText="CategroyId"
                                                ReadOnly="True" SortExpression="CategroyId" UniqueName="CategroyId" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridTemplateColumn DataField="CategroyName" HeaderText="Categroy Name" SortExpression="CategroyName"
                                                UniqueName="CategroyName">
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ID="temp1" Text='<%#Bind("CategroyName") %>' />
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="txtCategoryName" runat="server" Text='<%#Bind("CategroyName") %>' />
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="*Required"
                                                        ControlToValidate="txtCategoryName"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn DataField="SoftwareId" DataType="System.Int32" HeaderText="Software"
                                                SortExpression="SoftwareId" UniqueName="SoftwareId" Visible="False">
                                                <ItemTemplate>
                                                    <asp:Label ID="Label21" runat="server" Text='<%# Bind( "SoftwareId") %>' />
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <asp:DropDownList ID="cmbSoftwareCategory" runat="server" DataSourceID="SqlDataSourceforSoftwareCategory"
                                                        Width="310px" DataValueField="SofwareId" DataTextField="SoftwareName" />
                                                    <%--SelectedValue='<%# Bind( "SoftwareId") %>'--%>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn DataField="SoftwareName" HeaderText="Software Name" SortExpression="SoftwareName"
                                                ReadOnly="true" UniqueName="SoftwareName">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridTemplateColumn DataField="Description" HeaderText="Description" SortExpression="Description"
                                                UniqueName="Description" Visible="False">
                                                <ItemTemplate>
                                                    <asp:Label ID="Label25" runat="server" Text='<%#Bind("Description") %>' />
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="txtDescription" runat="server" Text='<%#Bind("Description") %>' />
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="*Required"
                                                        ControlToValidate="txtDescription"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn DataField="IsActive" DataType="System.Boolean" HeaderText="IsActive"
                                                SortExpression="IsActive" UniqueName="IsActive" Visible="False">
                                                <ItemTemplate>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <asp:CheckBox ID="chkActive" runat="server" Checked='<%# Eval("IsActive") == DBNull.Value? true : Eval("IsActive") %>' />
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn DataField="ExamName" HeaderText="ExamName" SortExpression="ExamName"
                                                UniqueName="ExamName" Visible="False">
                                                <ItemTemplate>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <asp:DropDownList ID="cmbExamCategory" runat="server" DataSourceID="SqlDataSourceforExamCategory"
                                                        Width="310px" DataValueField="ExamId" DataTextField="ExamName" />
                                                    <%-- SelectedValue='<%# Bind( "ExamId") %>'--%>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <EditFormSettings>
                                            <EditColumn ButtonType="PushButton" HeaderStyle-HorizontalAlign="Right">
                                                <HeaderStyle HorizontalAlign="Right"></HeaderStyle>
                                            </EditColumn>
                                        </EditFormSettings>
                                        <PagerStyle AlwaysVisible="True" />
                                    </MasterTableView>
                                    <PagerStyle AlwaysVisible="True" />
                                </telerik:RadGrid>
                                <asp:SqlDataSource ID="CategoryDatasource" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString  %>"
                                    SelectCommand="SELECT CategoryDetails.CategroyId, CategoryDetails.CategroyName, CategoryDetails.SoftwareId, SoftwareDetails.SoftwareName, CategoryDetails.Description, CategoryDetails.IsActive, ExamDetails.ExamId, ExamDetails.ExamName FROM CategoryDetails INNER JOIN SoftwareDetails ON CategoryDetails.SoftwareId = SoftwareDetails.SofwareId INNER JOIN ExamDetails ON CategoryDetails.ExamId = ExamDetails.ExamId">
                                </asp:SqlDataSource>
                                <asp:SqlDataSource ID="SqlDataSourceforSoftwareCategory" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString  %>"
                                    SelectCommand="SELECT SofwareId, SoftwareName FROM SoftwareDetails"></asp:SqlDataSource>
                                <asp:SqlDataSource ID="SqlDataSourceforExamCategory" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString  %>"
                                    SelectCommand="SELECT ExamId, ExamName FROM ExamDetails"></asp:SqlDataSource>
                            </ContentTemplate>
                        </telerik:RadPanelItem>
    </Items>
    </telerik:RadPanelBar >

Back to Top