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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:41:51+00:00 2026-05-23T02:41:51+00:00

HI, I have a list of coursesTaken with dates (returned by a nested class).

  • 0

HI,
I have a list of coursesTaken with dates (returned by a nested class). Since I am not sure howmany courses the person took, I just bind it to textboxes and is working fine. The datacontext of the grid is the list itself so I assume whenever I make changes to the form, it is automatically sent back to the list and add it, but when it is time to save it in DB, the list won’t change. I tried making the list as an observable collection and bind mode two way but still won’t change. when I try to put Onpropertychange it says “Cannot acces a non static member of outer type via nested type…” What I want to do is whenever I type / add something to textbox, the list will add it as it’s nth item so I can iterate and save it in DB.

is ther any other way to do this? please see code below. thanks!

    #region class for binding purposes (nested class)
    public class ListCon
    {
        public ObservableCollection<tblGALContinuingEducationHistory> EducList
        {
            get
            {

                return new ObservableCollection<tblGALContinuingEducationHistory>(contEducHstoryList);
            }

        }
    }
    #endregion

    #region constructor
    public ContinuingEducHistoryPopUp(tblAttorneyGalFileMaint currentGal)
    {

        contEducHstoryList = new ObservableCollection<tblGALContinuingEducationHistory>();
        InitializeComponent();

        if (currentGal != null)
        {
            CurrentGal = currentGal;
            txtMemberName.Text = CurrentGal.FullName;
            contEducHstoryList = new ObservableCollection<tblGALContinuingEducationHistory>(currentGal.tblGALContinuingEducationHistories.Count > 0 && currentGal.tblGALContinuingEducationHistories != null ? currentGal.tblGALContinuingEducationHistories : null);
        }
        this.DataContext = new ListCon();


    }
    #endregion

Now here’s my xaml

<Grid Grid.Row="2" Grid.ColumnSpan="2" Name="grdEducForm">
    <Grid.RowDefinitions>
        <RowDefinition Height="25" />
        <RowDefinition Height="25" />
        <RowDefinition Height="25" />
        <RowDefinition Height="25" />
        <RowDefinition Height="25" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="2*" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <TextBox Text="{Binding Path=EducList[0].CourseTitle}" Grid.Column="0" Grid.Row="0" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[0].CertificateDate}" Grid.Column="1" Grid.Row="0" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[0].CertificateExpiration}" Grid.Column="2" Grid.Row="0" />

    <TextBox Text="{Binding EducList[1].CourseTitle}" Grid.Column="0" Grid.Row="1" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[1].CertificateDate}" Grid.Column="1" Grid.Row="1" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[1].CertificateExpiration}" Grid.Column="2" Grid.Row="1" />

    <TextBox Text="{Binding Path=EducList[2].CourseTitle}" Grid.Column="0" Grid.Row="2" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[2].CertificateDate}" Grid.Column="1" Grid.Row="2" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[2].CertificateExpiration}" x:Name="dpEnd3"
            Grid.Column="2" Grid.Row="2" />

    <TextBox Text="{Binding Path=EducList[3].CourseTitle,  Mode=TwoWay}" Grid.Column="0" Grid.Row="3" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[3].CertificateDate, Mode=TwoWay}" Grid.Column="1"
            Grid.Row="3" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[3].CertificateExpiration}" Grid.Column="2" Grid.Row="3" />

    <TextBox Text="{Binding Path=EducList[4].CourseTitle}" Name="txtEducName5" Grid.Column="0" Grid.Row="4" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[4].CertificateDate}" x:Name="dpStart5" Grid.Column="1"
            Grid.Row="4" />
    <useable:MaskedDatePicker DateValue="{Binding Path=EducList[4].CertificateExpiration}" x:Name="dpEnd5"
            Grid.Column="2" Grid.Row="4" />
</Grid>
  • 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-23T02:41:52+00:00Added an answer on May 23, 2026 at 2:41 am
    EducList = new ObservableCollection<tblGALContinuingEducationHistory>(currentGal.tblGALContinuingEducationHistories.Count > 0 && currentGal.tblGALContinuingEducationHistories != null ? currentGal.tblGALContinuingEducationHistories : null);
    
                int count = 0;
               //5 is the maximum no of course an atty can take and save in this form   
                count = 5 - EducList.Count;
                for (int i = 0; i < count; i++)
                {
                    galContEdu = FileMaintenanceBusiness.Instance.Create<tblGALContinuingEducationHistory>();
                    galContEdu.AttorneyID = currentGal.AttorneyID;
                    EducList.Add(galContEdu);
                }
    

    then save only the ones that has data:

    foreach (var item in EducList)
                {
                   if(!string.IsNullOrEmpty(item.CourseTitle) || !string.IsNullOrWhiteSpace(item.CourseTitle))
                    FileMaintenanceBusiness.Instance.SaveChanges(item, true);
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have List<Custom> where Custom is class Custom { public int id; public String
I have list of objects type Node ( items ). And Node class has
I have List of User object, I just want to get User objects from
I have list of groups: <select multiple=multiple name=groups[] id=groups[] class=myclass> <option value=1>Employee</option> <option value=2>Suppliers</option>
I have list of objects which are returned from mvc controller as Json. I'm
I have list of links, like: <div class=links> <a href=# class=link1>link 1</a> <a href=#
i have List<List<Person>> i want it to copy all people in the previous collection
I have list of input area in the form with id like contact1_title, contact2_title,
I have list of articles on the page in table and i want to
I have list of structure. I want to modify a particular data from the

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.