Originally Posted by
Daniil
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.")
)
)
)
)
)