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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:31:08+00:00 2026-05-27T11:31:08+00:00

I Have a bound Data grid view to the below Questions Class: public class

  • 0

I Have a bound Data grid view to the below Questions Class:

public class Questions()

{

public int QuestionId{get; set;}
public string Question {get; set;}
public List<Answers> AvailableAnswers {get; Set;}
public string SelectedAnswer {get; set;}

}

public class Answers()
{

public int AnswerId {get; set;}
public string Answer {get; set;}
public bool IsSelected {get; set;}

}

What I need is within my Datagrid to show the Available Answers as Radio buttons and when the user selects one of the radio buttons for the AnswerId to be set as the SelectedAnswer property in the Questions Class.

Can anyone help as i have been going round in circles trying to do 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-05-27T11:31:09+00:00Added an answer on May 27, 2026 at 11:31 am

    There are a few ways you can do this if you are using MVVM within your view-model you can create a public property such as

    private bool _isAnswer1;
        public bool IsAnswer1
        {
            get { return _isAnswer1; }
            set
            {
                _isAnswer1 = value;
                NotifyPropertyChanged(m => m.IsAnswer1); //I used i notify property changed but this is inherited from the base class
            }
        }
    

    And then in the UI binding similar to

    <CheckBox x:Name="testCheckBox" IsChecked="{Binding IsAnswer1}   />
    

    Assuming you have the data context set at the grid or main view to the view model.

    You could then bind this property to the UI and when checked it could then invoke a different action or method for another element. It just depends upon how you implement this.

    If you are not using mvvm and you want to handle this in the ui you can use elementName binding. Here you basically bind property of one element on the value of another (Example check a checkbox and have a value appear in the UI) Here is a link from MSDN on element name binding
    MSDN Link Here

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

Sidebar

Related Questions

I have a grid view that is data bound to a dataset. In a
I have a data grid in a view that is bound to a List
I have a data table bound to a data grid view, one of the
In my project I have an Xceed data grid which is bound to a
I have a grid view which I am binding with data table. My problem
I have a WPF Data Grid bound to an observable collection, which is working
We have a data grid on a window that is bound to a collection
When I try to update a LINQ data source bound to a grid view,
i have little dilemma, i often use data-bound controls such as Gridview in conjunction
I have string column with numbers in a datagridview.It is not bound, I would

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.