Show edit form by grouping the data

12 posts, 0 answers
  1. Aho
    Aho avatar
    21 posts
    Member since:
    Oct 2009

    Posted 08 Jan 2010 Link to this post

    Hello

    I have a RadGrid with one Group. The data is seperated by the groups in a proper way.
    So from this point everything is ok.

    Data should be added by an edit form (modal popup).
    Now I try to display the edit form, but it's just appearing if I press "Add new record".
    Pressing "Edit" in a row does not show the edit form.

    If remove the grouping of the RadGrid, the edit form appears as expected!

    What's the reason for this behaviour?

    Here is my code:

        <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">  
        </asp:ScriptManagerProxy> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="gridMain">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="gridMain" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="imgSearch" /> 
     
                   </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="imgSearch">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="gridMain" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="Center" 
            Skin="Vista" /> 
     <telerik:RadGrid runat="server" ID="gridMain" Width="50%" Style="margin-left: auto;  
                margin-right: auto; margin-top: 5px"> 
                <ClientSettings> 
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
                </ClientSettings> 
                <GroupingSettings /> 
                <MasterTableView AutoGenerateColumns="false" CommandItemDisplay="Top" AllowPaging="true" 
                    DataKeyNames="BMID" GroupsDefaultExpanded="false" PageSize="100" EditMode="PopUp" GroupLoadMode="Server">  
                    <GroupByExpressions> 
                        <telerik:GridGroupByExpression> 
                            <GroupByFields> 
                                <telerik:GridGroupByField FieldName="BMITEM" FieldAlias="Item" /> 
                            </GroupByFields> 
                            <SelectFields> 
                                <telerik:GridGroupByField FieldName="BMITEM" FieldAlias="Item" /> 
                            </SelectFields> 
                        </telerik:GridGroupByExpression> 
                    </GroupByExpressions> 
                      
                    <Columns> 
                        <telerik:GridEditCommandColumn> 
                        </telerik:GridEditCommandColumn> 
                        <telerik:GridBoundColumn HeaderText="Status" DataField="BMSTAT">  
                            <HeaderStyle Width="25px" /> 
                            <ItemStyle Width="25px" /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn HeaderText="Seq." DataField="BMSEQN">  
                            <HeaderStyle Width="25px" /> 
                            <ItemStyle Width="25px" /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn HeaderText="Child item" DataField="BMCHLD">  
                            <HeaderStyle Width="150px" /> 
                            <ItemStyle Width="150px" /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn HeaderText="Description">  
                            <HeaderStyle Width="150px" /> 
                            <ItemStyle Width="150px" /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn HeaderText="Quantity" DataField="BMQTY">  
                            <HeaderStyle Width="25px" /> 
                            <ItemStyle Width="25px" /> 
                        </telerik:GridBoundColumn> 
                    </Columns> 
                    <EditFormSettings EditFormType="Template" InsertCaption="Add new BOM entry" CaptionFormatString="Edit item {0}" 
                        CaptionDataField="BMID">  
                        <PopUpSettings Modal="true" /> 
                        <FormTemplate> 
                            <table> 
                                <tr> 
                                    <td> 
                                        Status  
                                    </td> 
                                    <td class="cellWithTextBox">  
                                        <asp:DropDownList ID="ddlStatus" runat="server">  
                                            <asp:ListItem Value="A">Active</asp:ListItem> 
                                            <asp:ListItem Value="D">Disabled</asp:ListItem> 
                                            <asp:ListItem Value="Z">Deleted</asp:ListItem> 
                                        </asp:DropDownList> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td align="center" colspan="4">  
                                        <asp:Button ID="btnUpdate" Text='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "Insert" : "Update" %>' 
                                            runat="server" CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>'>  
                                        </asp:Button>&nbsp;  
                                        <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" 
                                            CommandName="Cancel" /> 
                                    </td> 
                                </tr> 
                            </table> 
                        </FormTemplate> 
                    </EditFormSettings> 
                </MasterTableView> 
            </telerik:RadGrid> 
       
     
     

            protected void gridMain_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
            {  
                LJITDataContext db = new LJITDataContext();  
                IQueryable<LJT_BOM> parts;  
                  
                var conditions = PredicateBuilder.True<LJT_BOM>();  
     
                int startRowIndex = this.gridMain.CurrentPageIndex * this.gridMain.PageSize;  
                int maximumRows = this.gridMain.PageSize;  
                conditions = conditions.And(p => p.BMITEM.Contains(this.txtFindName.Text));  
                conditions = conditions.And(p => p.BMCHLD.Contains(this.txtFindChild.Text.Trim()));  
                parts = db.BOM.Where(conditions).OrderBy(o => o.BMITEM).ThenBy(o => o.BMSEQN);  
     
                this.gridMain.VirtualItemCount = parts.Count();  
                var alles = parts.Skip(startRowIndex).Take(maximumRows);  
                this.gridMain.DataSource = parts;  
  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 13 Jan 2010 Link to this post

    Hello Aho,

    I reviewed the setup, and the code looks correct.
    If the issue persists, you can open a formal support ticket, and send us a small working project, demonstrating your setup, and showing the unwanted behavior.
    We will debug it locally, and advise you further.

    Best wishes,
    Yavor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CH
    CH avatar
    28 posts
    Member since:
    Nov 2008

    Posted 19 Jan 2010 Link to this post

    I go the same behaviour as well.... edit popup form template is not appear after grouping. is there any solution work out?

    Thks

    Edmond
  5. Aho
    Aho avatar
    21 posts
    Member since:
    Oct 2009

    Posted 20 Jan 2010 Link to this post

    I was wondering that I am the only one how runs into this issue.

    It seems that this is a problem with the RadGrid itself.
    As far as I know, there still isn't a workaround for this.
  6. CH
    CH avatar
    28 posts
    Member since:
    Nov 2008

    Posted 20 Jan 2010 Link to this post

    AHo:
       I don't think you are the only one..... it seems the bug for telerik grid. i tried the grid in the other application. the problem also appear. if there is not further feedback then i will submit a support ticket tomorrow.... if you can find some workaround then please kindly to let me know to. thks 
  7. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 22 Jan 2010 Link to this post

    Hi CH,

    It is very important that we replicate the precise settings, which demonstrate this behavior.
    Attached to this message, you will find a small project, which handles a similar setup, and behaves as expected.
    You can either use it to introduce any additional settings, which replicate the issue, or open a formal support ticket, and send a separate project.

    Kind regards,
    Yavor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Aho
    Aho avatar
    21 posts
    Member since:
    Oct 2009

    Posted 22 Jan 2010 Link to this post

    Hi Yavor

    Can you confirm, that your example does not work if you set the MasterTableView property:

     

    GroupsDefaultExpanded="false"

     

     

  9. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 22 Jan 2010 Link to this post

    Hello CH,

    As a quick follow up on the post which I made previously.
    I further tracked the issue, and, depending on the number of records displayed, a similar issue to the one which you described is shown. This behavior is caused by a limitation in the rendering mechanism of the grid, introduced to workaround a bug in IE. One custom solution, which can be used to eliminate this behavior is shown in this forum thread:

    http://www.telerik.com/community/forums/aspnet-ajax/grid/popup-form-template-is-not-appear-after-grouping.aspx

    I hope this information helps.

    Sincerely yours,
    Yavor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. Thomas
    Thomas avatar
    1 posts
    Member since:
    Dec 2011

    Posted 27 Jul 2012 Link to this post

    I am having the exact problem as documented in this thread.  I downloaded the WebSite1 example and was able to make is fail by adding the setting the property GroupsDefaultExpanded="False" in the MasterTableView.

    I then modified the property on my form and still the edit form would not open.  I then set the set the property GroupLoadMode="Client" in the MasterTableView and everything works!

    I can run like this for the short term but as this form has the potential for displaying a large amount of information this needs to be addressed and sending everything to the client is not the solution.

    Thanks

    Tom

  11. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 31 Jul 2012 Link to this post

    Hi,

    As mentioned in the pointed forum thread - Currently using Popup Edit Form when both grouping and scrolling are enabled is not supported in RadGrid due to browser limitation. Please excuse us for the inconvenience caused.

    All the best,
    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.
  12. Ashraf
    Ashraf avatar
    40 posts
    Member since:
    Aug 2012

    Posted 23 Aug 2012 Link to this post

    still not solved i face the same issue please what is other solution 
  13. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 28 Aug 2012 Link to this post

    Hi,

    I am afraid that this scenario is currently unsupported. Sorry for the inconvenience.

    All the best,
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017