Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8848175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:21:55+00:00 2026-06-14T12:21:55+00:00

I have grid in index page and i have another grid in Data page.

  • 0
I have grid in index page and i have another grid in Data page. 

On grid on Index page i clicked click view record and then redirect to Data page which also contain the grid. My question is how i can filter grid in Data page based on selected record in grid in Index page.

As you can see, in method GetAllList i tried to filter the grid using rListID which come from the grid on Index page.

Please advise how i can achieve this. Thank you

Index page (View)

    @(Html.Kendo().Grid<HApp.Models.SModel>()

        .Name("Grid")
        .HtmlAttributes(new { @Style = "align:center; font-size:10.5px; length:100%" })
        .Columns(columns =>
        {

            columns.Bound(p => p.RListID).Visible(false);
            columns.Bound(p => p.TListID).Visible(false);
            columns.Command(commands => commands.Edit()).Width(175);
            columns.Command(command => command.Custom("View").Click("OnshowDetails")).Width(150);


        })


        .Selectable(s => s.Mode(Kendo.Mvc.UI.GridSelectionMode.Single))
        .Pageable()
        .Scrollable()
        .DataSource(dataSource => dataSource
            .Ajax()//bind with Ajax instead server bind
            .PageSize(10)
            .ServerOperation(true)
                .Model(model => model.Id(p => p.RListID))


            .Read(read => read.Action("GetCData", "CDetails").Type(HttpVerbs.Get))

        )
        //.Events(events => events
        //                        .Change("change"))



    )


    <script type="text/javascript">


        function OnshowDetails(e) {
           var grid = $('#Grid').data('kendoGrid');   //get a reference to the grid data 
           var record = grid.dataItem(grid.select()); //get a reference to the currently selected row
           var rListID = record.RListID;

           window.location.href = "@Url.Action("Data ", "CDetails")" + "/?rListID =" + rListID ; 




        }
    </script>


Data Page View

@(Html.Kendo().Grid<HApp.Models.SListsModel>()

    .Name("SList")
    .HtmlAttributes(new { @Style = "align:center; font-size:10.5px; length:100%" })
    .Columns(columns =>
    {
        columns.Bound(p => p.RListID).Visible(false);
        columns.Bound(p => p.CCID);



        columns.Command(commands => commands.Edit()).Width(175);      
    })


    .Pageable()
    .Selectable(s => s.Mode(Kendo.Mvc.UI.GridSelectionMode.Single))
    .Scrollable()
    .DataSource(dataSource => dataSource
        .Ajax()//bind with Ajax instead server bind
        .PageSize(5)
        .ServerOperation(true)
        .Model(model => model.Id(p => p.CID))

        .Read(read => read.Action("GetListData", "CDetails").Type(HttpVerbs.Get))

    )
    .Events(events => events
                            .Change("change"))



)


Controller:

    public ActionResult Index()
    {

                return View();

    }

    public ActionResult Detail()
    {

            return View();
    }


/// <summary>
        /// Bind to GetListData
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public ActionResult GetListData([DataSourceRequest] DataSourceRequest request)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            return Json(GetAllList().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }

         private static IEnumerable<SListsModel> GetAllList(Guid rListID)
        {


            var context = new HEntities();

            return context.SLists
                .Where(filter => filter.RListID== rListID)
                .Select(s_list => new SessionListsModel
                {

                    RListID = s_list.RListID,
                    CCID = s_list.CCID,



                });

        }



 public ActionResult GetCData([DataSourceRequest] DataSourceRequest request)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            return Json(GetAllComList().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }

        /// <summary>
        /// Get all available session from Session table
        /// </summary>
        /// <returns></returns>
        private static IEnumerable<SModel> GetAllComList()
        {
            var context = new HEntities();

            return context.SM
                .Select(com_list => new SModel
                {
                    RListID = com_list.RListID,
                    PortID = com_list.PortID ,



                });

        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:21:57+00:00Added an answer on June 14, 2026 at 12:21 pm

    To set initial filtering of the Grid I suggest you to use the Filter method of the DataSource configurator object.

    .DataSource(dataSource => dataSource
                .Ajax()                
                .Filter(flt=>flt.Add(c=>c.RListID).EndsWith(rListIDValuePassedFromController))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rad Grid View that I'm using to display some data and
I have a grid in which, I load data from database. I need to
I have a jqgrid on my page which loads the first page of data
I have a grid view on a page and the row height can vary.
I have one jsp page with jqgrid I want to pass that grid data
I have a site, which show all products in a grid on its index
I have grid with some textboxes and an image which goes out of grid
I have grid in my ASP.NET page (actualy it's Telerik RadGrid). There is GridButtonColumn
I have grid something like this: Ext.define('Exp.view.dashboard.Tv', { extend: 'Ext.grid.Panel', initComponent: function() { this.columns
I am using vb.net code. I have grid view, please see the code below:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.