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

  • Home
  • SEARCH
  • 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 8535221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:22:55+00:00 2026-06-11T10:22:55+00:00

In my project i’m using dynamic data controls to generate lable , textbox ,

  • 0

In my project i’m using dynamic data controls to generate lable , textbox , dropdownlist

I’m binding all values using .dbml class as using linq to sql

now when i populate my dropdown with following code it is populated all the values which is there in table Users but i want to show only some values how can i achieve that?

code:

  partial class WorkFlow{}

    [DisplayName("Flow")]
    [DisplayColumn("FlowItem", "InitDate", true)]
    public class FlowMeta
    {
        [Display(Name = "Trade", Order = 1)]
        public WorkFlowItem WorkFlowItem { get; set; }

        [Display(Name = "Users", Order = 2)]
        public Users User { get; set; }
    }  

Here it is populating all the records from Users table and dynamically bind it to dropdownlist how can I modify this?

  • 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-11T10:22:57+00:00Added an answer on June 11, 2026 at 10:22 am

    You can create a Function in this way in your Contorller:

     public void populatelistbox()
        {
    
            int id = Convert.ToInt32(Session["user"].ToString());
    
            var enroll = from s in db.EnrollTrainee
                         join a in db.CreateUsers on s.TraineeID equals a.User_Userid
                         where s.TrainerID == id
                         select new { a.User_Userid, a.User_name };
    
            ViewBag.Enroll = new MultiSelectList(enroll, "User_Userid", "User_name");
        }
    

    You need to Perform Some Conditions in your Lambda Operations according to your requirement.

    After that you can Call this Function in this way:

        [HttpGet]
        public ActionResult Create()
        {
            populatelistbox();
            return View();  
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This project is in Obj-C for iphone. I'm using the double float version of
Project CompetitionServer.exe raised exception class ESQLiteException with message 'Error executing SQL. Error [1]: SQL
Project A contains a WPF Window (Data Entry Form) with a stack panel of
Project: Take Wikipedia's list of Roman consuls, put the data in a CSV so
Project Structure I have a silverlight project SLProj, that references a silverlight class library
Project Scenario Technology : Dotnetnuke (Approx. 100 - 150 screens) Data Architecture : LINQ
project: Using VB.NET to build a winforms database interface and work-automation app. I am
project: Using VB.NET to build a winforms database interface and work-automation app. I am
My project is using Guice as the IOC container responsible for providing dependencies (service
My project is currently using a svn repository which gains several hundred new revisions

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.