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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:17:39+00:00 2026-05-30T07:17:39+00:00

High level view of the application is: Form1 displays client information in a DataGridView

  • 0

High level view of the application is:

  • Form1 displays client information in a DataGridView (pulled from a DB).
  • I save the client’s information from the DataGridView in properties located in a Client class.
  • From Form1, the user can click a button that instantiates Form2 and allows the client’s information to be modified.
  • Form2’s constructor has a Client object as a parameter. This object is what holds all the client’s information from Form1. Using this object i can re-populate the fields that i want the user to be able to edit on Form2.

There is a table in the DataSource that holds all the case types (ie. CaseType1, CaseType2, CaseType3).

I then use a ComboBox and populate it with all the case types from the DataSource when the form is instantiated. My ComboBox settings are as follows:

DataSource: set to my CaseTypeBindingSource which has the columns and data i need.
DisplayMember: The result of the query being used.
ValueMember: The result of the query being used. (same as DisplayMember)
SelectedValue: I have tried it with “none” and with the same value as DisplayMember and ValueMember.

Here’s the problem:

At run-time, i want to be able to assign the client’s case type that was brought over from Form1 as the item that is currently selected in the ComboBox (SelectedItem).

I could just assign the case type to a textbox and be done with it. But the idea is that i would like the form to show the user what the client’s case type is, and allow him/her to change it by using the ComboBox.

The ComboBox name is CaseTypeComboBox. The object holding the case type information and its property is client.CaseType.

I’ve tried the following inside the constructor:

CaseTypeComboBox.SelectedItem = client.CaseType;

I’ve also tried creating a class variable in Form2 called origCaseType, assigning the client.CaseType value to the origCaseType class variable in the constructor. Then doing the following when the Form2_Load(…) event fires:

CaseTypeComboBox.SelectedValue = origCaseType;

Does anyone have any thoughts on this? Any similar experience?

Please let me know if anything needs clarification, any help is appreciated.

Thanks in advance!

TS

“Form2” Constructor:

public ModifyCase(Client client)
{
    InitializeComponent();
    CaseNumberTextBox.Text = client.CaseNumber;
    LoadStatusComboBox(client.Status);
    LoadIsClosedRadioButton(client.IsClosed);
    LoadIsInStorageRadioButton(client.IsInStorage);
    LastModifiedTextBox.Text = client.LastModified.ToString();
    NotesTextBox.Text = client.Notes;

    origCaseType = client.CaseType;
}

“Form2” Load event:

private void ModifyCase_Load(object sender, EventArgs e)
{
    //Fills the ComboBox box with case types
    this.case_typesTableAdapter1.Fill(this.testDataSet1.case_types);

    //Attempts to set value for client's case type from Form1
    CaseTypeComboBox.SelectedValue = origCaseType;
    //Just to help me see what these variables are holding to figure
    //out the problem...
    MessageBox.Show(origCaseType);
    MessageBox.Show(CaseTypeComboBox.SelectedIndex.ToString());
}
  • 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-30T07:17:40+00:00Added an answer on May 30, 2026 at 7:17 am

    I made two small adjustments that did the trick! The problem was i had set SelectedItem and SelectedValue to the DataSource column i’m using. Except, all the was needed was to set those two values to “none”, and set the ValueMember and DisplayMember to the DataSource column. Thanks for your time wdavo!

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

Sidebar

Related Questions

I'd like to know (from a high level view) what would be required to
It's very easy to explain NoSQL from high level view - it is basically
High Level Goal: Create a single Maven Web Application project that can be used
High Level With StructureMap, Can I define a assembly scan rule that for an
Are there compilers for high-level languages (such as C) which can be targeted to
Are there any high-level, cross-platform, and abstracted (simple to use) widget toolkits for C
I find that many high level functions are missing in most well-known javascript libraries
Are there any high level language that don't support using C++ libraries?
I'd like to document what high-level (i.e. C++ not inline assembler ) functions or
Here's my problem at a high level: We have two business applications. App1 inputs

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.