moongirl129
Programmer
I have a class called company as follows:
and my Issue class looks like:
On my UI I have a datagrid for each bindinglist - I've set up a bindingsource for company.issues1 and company.issues2. The user enters each issue straight into the datagrid and this in turn keeps the 'thisCompany' object updated.
Here's my problem:
Each issue needs to have a unique reference number, an integer starting from 1. But these numbers need to increment across both bindinglists. For instance if the user enters 5 issues for 'issues1' the first Issue entered for the 'issues2' bindingList should have a reference number of 6.
I am really stumped as to how to do this!! Can anyone help??
Code:
public class Company
{
public BindingList<Issue> Issues1
{
get { return issues1; }
set { issues1 = value; }
}
public BindingList<Issue> Issues2
{
get { return issues2; }
set { issues2 = value; }
}
...other properties
}
and my Issue class looks like:
Code:
public class Issue : NotifyProperyChangedBase
{
public int RefNumber
{
get { return refNumber; }
set { refNumber = value; }
}
....other properties
}
On my UI I have a datagrid for each bindinglist - I've set up a bindingsource for company.issues1 and company.issues2. The user enters each issue straight into the datagrid and this in turn keeps the 'thisCompany' object updated.
Here's my problem:
Each issue needs to have a unique reference number, an integer starting from 1. But these numbers need to increment across both bindinglists. For instance if the user enters 5 issues for 'issues1' the first Issue entered for the 'issues2' bindingList should have a reference number of 6.
I am really stumped as to how to do this!! Can anyone help??