Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
260
MVC Grid : Custom Paging /SubGrids
posted

I'm facing very serious problem in custom paging for parent grid as well as sub grids. 

Please if possible then provide me sample code in MVC with custom paging(not able to make model for pagesize , pageindex as well)

below is the code which i'm working with:

InvModel

InvId

InvName

Cons -> InvId, ConId, ConName

Funs -> InvId, FunId, FunName

@(Html.Infragistics().Grid<InvModel>()
.ID("SearchGrid")
.PrimaryKey("InvId")
.DataMember("Invs")
.Columns(column =>
{
    column.For(x => x.InvName).HeaderText("Inv Name").Width("100%");
})
.ColumnLayouts(
layouts =>
   {
      layouts.For(x => x.Cons)
      .PrimaryKey("ConId")
      .ForeignKey("InvId")
      .DataMember("Cons")
      .Columns(column =>
     {
         column.For(x => x.ConName).HeaderText("Con Name").Width("100%");
      });
      layouts.For(x => x.Funs)
      .PrimaryKey("FunId")
      .ForeignKey("InvId")
     .DataMember("Funs")
      .Columns(column =>
      {

          column.For(x => x.FunName).HeaderText("Fun Name").Width("100%");
      });
})
.DataSourceUrl(Url.Action("InvsList"))
.DataBind()
.Render()
)

Controller Logic

model = select new InvModel()
{
InvId = c.Field<long>(0),
InvName = c.Field<string>(1),
Funs = select new FunModel()
         {
            FunId = d.Field<long>(0),
            FunName = d.Field<string>(1),
          }).AsQueryable(),
Cons = select new ConModel()
      {
          ConId = f.Field<long>(0),
          ConName = f.Field<string>(1),
       }).AsQueryable()
}).ToList();
return model.AsQueryable()

Problem faced:

1. custom paging model not working. here i'm not providing you so if possible then construct for me it would be great help for me

2. sub grids never follower remote paging. it always work in local. so please give me its code as well. frankly speaking, how it will work i'm not able to understand.