Click here to Skip to main content
15,893,588 members
Home / Discussions / C#
   

C#

 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463764-Aug-18 11:39
Member 138463764-Aug-18 11:39 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff4-Aug-18 21:52
mveOriginalGriff4-Aug-18 21:52 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463765-Aug-18 1:16
Member 138463765-Aug-18 1:16 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff5-Aug-18 1:28
mveOriginalGriff5-Aug-18 1:28 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Eddy Vluggen5-Aug-18 5:54
professionalEddy Vluggen5-Aug-18 5:54 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff5-Aug-18 6:07
mveOriginalGriff5-Aug-18 6:07 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Eddy Vluggen5-Aug-18 10:49
professionalEddy Vluggen5-Aug-18 10:49 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463766-Aug-18 9:18
Member 138463766-Aug-18 9:18 
Why is this code not working?
I am trying to set a {get} property to return a copy of any list.
Just so that I would understand how this syntax is supposed to work.
To me this code looks exactly the same as in every toutorial on the internet.

namespace WpfApp5
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            string a = "aaaaaa";
            string b = "bbbbbb";

            List<string> ab = new List<string>
            {
                a,
                b
            };

               public List<string> Ab
             { get { return new List<string>(ab); } }



        }



    }
}


and it returns error that "ab" doesn't exist in the current context in the {get} line...

this also doesn't work:

  public List<string> Ab
{ get { return ab; } }


modified 6-Aug-18 15:26pm.

GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff6-Aug-18 21:50
mveOriginalGriff6-Aug-18 21:50 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463767-Aug-18 3:23
Member 138463767-Aug-18 3:23 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Richard Deeming7-Aug-18 3:55
mveRichard Deeming7-Aug-18 3:55 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff7-Aug-18 4:10
mveOriginalGriff7-Aug-18 4:10 
SuggestionRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Richard Deeming7-Aug-18 4:57
mveRichard Deeming7-Aug-18 4:57 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 1384637619-Aug-18 3:28
Member 1384637619-Aug-18 3:28 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Richard Deeming20-Aug-18 7:52
mveRichard Deeming20-Aug-18 7:52 
QuestionWant to change the Validation attribute at runtime ASP.Net MVC Pin
indian1433-Aug-18 7:57
indian1433-Aug-18 7:57 
AnswerRe: Want to change the Validation attribute at runtime ASP.Net MVC Pin
Gerry Schmitz3-Aug-18 9:18
mveGerry Schmitz3-Aug-18 9:18 
GeneralRe: Want to change the Validation attribute at runtime ASP.Net MVC Pin
indian1433-Aug-18 10:17
indian1433-Aug-18 10:17 
AnswerRe: Want to change the Validation attribute at runtime ASP.Net MVC Pin
Richard Deeming3-Aug-18 10:21
mveRichard Deeming3-Aug-18 10:21 
GeneralRe: Want to change the Validation attribute at runtime ASP.Net MVC Pin
indian1433-Aug-18 11:16
indian1433-Aug-18 11:16 
GeneralRe: Want to change the Validation attribute at runtime ASP.Net MVC Pin
Richard Deeming3-Aug-18 12:14
mveRichard Deeming3-Aug-18 12:14 
GeneralRe: Want to change the Validation attribute at runtime ASP.Net MVC Pin
indian1433-Aug-18 12:48
indian1433-Aug-18 12:48 
GeneralRe: Want to change the Validation attribute at runtime ASP.Net MVC Pin
Richard Deeming6-Aug-18 2:05
mveRichard Deeming6-Aug-18 2:05 
GeneralRe: Want to change the Validation attribute at runtime ASP.Net MVC Pin
indian1436-Aug-18 6:39
indian1436-Aug-18 6:39 
GeneralRe: Want to change the Validation attribute at runtime ASP.Net MVC Pin
Richard Deeming6-Aug-18 7:15
mveRichard Deeming6-Aug-18 7:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.