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 6831157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:42:15+00:00 2026-05-26T22:42:15+00:00

Assume we have these two tables, binded by foreign key CAT_ID: Category[CAT_ID,CAT_NAME] cat_id =

  • 0

Assume we have these two tables, binded by foreign key CAT_ID:

Category[CAT_ID,CAT_NAME]
cat_id = 1, cat_name= Classical
cat_id = 2, cat_name = Jazz
…

MusicAlbums[ALBUM_ID, ALBUM_NAME, CAT_ID]
album_id = 1, album_name = Wagner – Parsifal, cat_id=1
album_id = 2, album_name = “Davis Miles – Kind of Blue, cat_id = 2

How can I display on MVC View instead of CAT_ID its value(that is : CAT_NAME) ?
like this:
———
Music
1 | Wagner – Parsifal | Classical
2 | Davis Miles – Kind of Blue | Jazz
———

Thank you

  • 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-05-26T22:42:16+00:00Added an answer on May 26, 2026 at 10:42 pm

    You want the Foreign Key feature (Its marked as new so may not have been available when you first looked):

    http://demos.telerik.com/aspnet-mvc/grid/foreignkeycolumn

    (View code (from their site, slightly cleaned up))

     Html.Telerik().Grid<ClientEditableOrder>()
           .Name("Grid")                      
           .Columns(columns =>
           {
               columns.Bound(o => o.OrderID).Width(100);
               columns.ForeignKey(o => o.EmployeeID, (IEnumerable<employee>)ViewData["employees"],
                   "ID", "Name").Width(230);
               columns.Bound(o => o.OrderDate).Width(150);
               columns.Bound(o => o.Freight).Width(220);               
           })
           //..etc..
           .Render();
    

    ViewData is set in the initial controller action:

    public ActionResult Edit() {
            var r = _userService.GetAllemployees().ToList();
            ViewData["employees"] = r;
            return View();
        }
    

    Their ‘AjaxEdit’ controller action does some funky stuff with explicitly listed foreign key ids in the parameters. But as my object exposed the FK fields I found in worked as expected without the need for any tricky business..

    Bonus points to anyone who can provide an example of filtering/sorting on the displayed value on these columns as these features apply themselves to the underlying ‘id’ value rather than the displayed string (annoying!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume I have two tables, Student Test Id Name TestId Type StudentId -- ----
Let's assume I have a database with two tables: categories and articles . Every
Assume I have a two tables, A and B. Table A has a primary
Assume that I have two parent tables: Company and Contact . Assume that both
Assume that we have two tables: Roles and Reports . And there exists a
I have two tables say ( FCT_SALES_SUMMARY_A and FCT_SALES_SUMMARY_B ). If we assume that
Let's assume that I have two tables... Foo and Bar. They contain the following
I have two tables: boughtItems(buyerId,ItemId) and denormalized(buyerId,item1,item2,item3,item4,item5) Let's assume that in boughtItems table each
Hello again Stackoverflow people! Assume I have these words: smartphones, smartphone I want to
I am new to ADO.net and have this problem: Let's assume I have these

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.