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

How to display 2 linked grid

2 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 19 Oct 2012, 12:11 AM
Hi,

I would like to filter grid 2 based on the row selection in the first grid and First grid has primary key called CustID and second grid has foreign key CustID.

Please advise how i can achieve this. Thank you

First Grid:
@(Html.Kendo().Grid(Model)
    .Name("SList")
        .HtmlAttributes(new { @Style = "align:center; font-size:10px;" })
    .Columns(columns => {
        columns.Bound(p => p.CCID);
        columns.Bound(p => p.CRN);
        columns.Bound(p => p.CFirstName).Width(140);
        columns.Bound(p => p.CFamilyName).Width(140);
        columns.Bound(p => p.Alias).Width(45);
        columns.Bound(p => p.CGender).Width(45);
        columns.Bound(p => p.CAge).Width(45);
        columns.Bound(p => p.CDOB).Format("{0:MM/dd/yyyy}");
        columns.Bound(p => p.RDate).Format("{0:MM/dd/yyyy}");
        columns.Bound(p => p.RFrom);
        columns.Bound(p => p.RComments);
        columns.Bound(p => p.ReferralTo);
        columns.Bound(p => p.CStatusID);
        columns.Bound(p => p.DateScheduled).Format("{0:MM/dd/yyyy}");
  
        columns.Command(commands => commands.Edit()).Width(175);
    })
    //.ToolBar(toolBar => toolBar.Save())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Navigatable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single)
                                        .Type(GridSelectionType.Row))
    .DataSource(dataSource => dataSource        
        .Ajax()
        .PageSize(10)   
        .Model(model => model.Id(p => p.CustID))
        .Read(read => read.Action("Index", "Management"))
        .Update(update => update.Action("Edit", "Management"))
      
    )
)

Second Grid:

@(Html.Kendo().Grid(Model)
    .Name("SList2")
        .HtmlAttributes(new { @Style = "align:center; font-size:10px;" })
    .Columns(columns => {
        columns.Bound(p => p.CreateDate).Format("{0:MM/dd/yyyy}");
        columns.Bound(p => p.CreateBy);
        columns.Bound(p => p.C3).Width(140);
   
  
        columns.Command(commands => commands.Edit()).Width(175);
    })
    //.ToolBar(toolBar => toolBar.Save())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Navigatable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single)
                                        .Type(GridSelectionType.Row))
    .DataSource(dataSource => dataSource        
        .Ajax()
        .PageSize(10)   
        .Model(model => model.Id(p => p.CEventID))
        .Read(read => read.Action("Index", "Management"))
        .Update(update => update.Action("Edit", "Management"))
      
    )
)

2 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 28 Oct 2012, 11:00 PM
i got it working. thx
0
Curtis Glesmann
Top achievements
Rank 1
answered on 28 Aug 2013, 02:48 PM
Hi Mark

How did you resolve this issue?

Thanks
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Curtis Glesmann
Top achievements
Rank 1
Share this question
or