[CLOSED] Nested Grid

  1. #1

    [CLOSED] Nested Grid

    I have list object, within this list have a data table object , I have issues to bind this datatable object to inner grid.

    I tried using below example.

    http://mvc.ext.net/#/GridPanel_RowExpander/Component/
    Last edited by Daniil; Jul 30, 2013 at 4:08 AM. Reason: [CLOSED]
  2. #2
    Hi @PriceRightHTML5team,

    Quote Originally Posted by PriceRightHTML5team View Post
    I have issues to bind this datatable object to inner grid.
    Please describe in greater details.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @PriceRightHTML5team,



    Please describe in greater details.


    I have class
        public class RuleDTO
        {
            public int RuleId { get; set; }
    
            public string CompanyId { get; set; }
    
            public string RuleName { get; set; }
    
            public DataTable ResultDatatable { get; set; }
        }
    I have bind the List<RuleDTO> to grid by referring below link sample

    http://mvc.ext.net/#/GridPanel_RowExpander/Component/

    In above sample when we expand it we will appear form fields i don't want form fields I have replace it by grid control (nested grid ) and datasource of this grid is ResultDatatable from list object
    as of now i have used hard coded ruleId 31, it should be mapped parent grid row.

    Below is the View source

    @(Html.X().GridPanel()
    
                .Width(510)
                .AutoScroll(true)
                .PaddingSpec("0 0 0 10")
                .Store(Html.X().Store()
                    .DataSource(Model.ExecutedResultDTOList)
                    .PageSize(10)
                    .Model(Html.X().Model()
                        .Fields(    
     Html.X().ModelField().Name("RuleId")
                             Html.X().ModelField().Name("ResultCount")
                             )
                    )
                )
                .ColumnModel(       
                    Html.X().Column().DataIndex("ResultCount").Text("ResultCount")
                )
                .BottomBar(Html.X().PagingToolbar().HideRefresh(true))
                    .Plugins(
                        Html.X().RowExpander()
                            .SingleExpand(false)
                            .Component(
                                    Html.X().FormPanel()
                                        .BodyPadding(6)
                                        .Height(180)
                                        .Border(false)
                                        .DefaultAnchor("-5")
                                        .Cls("white-footer")
                                        .Items(                                    
                                                Html.X().GridPanel().EnableColumnHide(false).Flex(1)
                                                .Flex(1)
                                                .ID("gridDataresult").Icon(Icon.ApplicationViewList)
                                                .Title("Rules")
                                                .Margins("0 0 0 0").Flex(1)
                                                .Hidden(false)
                                                .AutoScroll(true)
                                                .Store(
                                                Html.X().Store()
                                                .RemotePaging(true)
                                                .PageSize(20)
                                                .AutoLoad(true)
                                                .Model(Html.X().Model()
                                                .Fields(
                                                new ModelField("CompanyName")))
                                                .DataSource(Model.ExecutedResultDTOList.Where(x=>x.RuleId == 31).Select(item=>item.ResultDatatable).ToList())
                                                )
                                                .ColumnModel(
                                                     Html.X().Column().Text("CompanyName").DataIndex("CompanyName")
                                                )
                                                .View(Html.X().GridView().StripeRows(true))
                                                .BottomBar(
                                                            Html.X().PagingToolbar().HideRefresh(true)
                                                            .EmptyMsg("No rule to display.")
                                                          )
                                                )
    
                                    )
    
                            )
             )
    Last edited by Daniil; Jul 30, 2013 at 4:08 AM. Reason: Please use [CODE] tags
  4. #4

Similar Threads

  1. Client Side Nested grid
    By yash.kapoor in forum 2.x Help
    Replies: 1
    Last Post: Dec 12, 2012, 5:07 AM
  2. Replies: 6
    Last Post: Oct 15, 2012, 6:20 AM
  3. [CLOSED] Nested data in nested grids
    By FAS in forum 1.x Legacy Premium Help
    Replies: 16
    Last Post: Apr 19, 2012, 7:51 PM
  4. Nested Grid Panels
    By JonC in forum 1.x Help
    Replies: 3
    Last Post: Dec 13, 2011, 7:46 PM
  5. Nested Grid
    By mirroras in forum 1.x Help
    Replies: 1
    Last Post: Apr 01, 2009, 3:01 PM

Posting Permissions