Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

Question about radiobuttons

Hi,

I use VS2010 and I programm in c#.

On my form I have 2 radiobuttons called "Ascending" and "Descending".
The radiobutton Descending is checked so its default. What I would like
is when the user presses the radiobutton Ascending the boolean named
grdSort is set to false in the Settings.Settings. And offcaurse if the user
presses the radiobutton Descending the boolean must set to True.

How can I do that?

Who knows the answer and is willing to help me?

Peter Kiers
0
peterkiers
Asked:
peterkiers
1 Solution
 
Meir RivkinFull stack Software EngineerCommented:
add event handlers for both radio buttons:

this.Ascending.CheckedChanged += new System.EventHandler(this.Ascending_CheckedChanged);

this.Descending.CheckedChanged += new System.EventHandler(this.Descending_CheckedChanged);

private void Ascending_CheckedChanged(object sender, EventArgs e)
        {
            grdSort = Ascending.Checked;
        }

        private void Descending_CheckedChanged(object sender, EventArgs e)
        {
            grdSort = Descending.Checked;
        }

Open in new window

0
 
peterkiersAuthor Commented:
Thanks.

Peter
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now