Finished the APC table saving code. Fixed a bug with the row parsing engine.
This commit is contained in:
@@ -96,6 +96,29 @@ namespace AdvertsingProfitControl
|
||||
dataGridView.Rows[i - 1].Cells[isMemberColumn].Value = false;
|
||||
dataGridView.Rows[i - 1].DefaultCellStyle.BackColor = Color.White;
|
||||
}
|
||||
//Then check to see if the next row is a member row
|
||||
rowStatus = parser.GetRowAttribute(dataGridView.Rows[i + 1]);
|
||||
if (rowStatus == RowAttribute.MemberRow)
|
||||
{
|
||||
//Set the current row and check for changes.
|
||||
if (!(bool)dataGridView.Rows[i].Cells[isHeaderColumn].EditedFormattedValue)
|
||||
{
|
||||
dataGridView.Rows[i].Cells[isDirtyColumn].Value = true;
|
||||
dataGridView.Rows[i].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||
}
|
||||
dataGridView.Rows[i].Cells[isHeaderColumn].Value = true;
|
||||
dataGridView.Rows[i].Cells[isMemberColumn].Value = false;
|
||||
dataGridView.Rows[i].DefaultCellStyle.BackColor = Color.LightGray;
|
||||
//Set the next row as a member row.
|
||||
if (!(bool)dataGridView.Rows[i + 1].Cells[isMemberColumn].EditedFormattedValue)
|
||||
{
|
||||
dataGridView.Rows[i + 1].Cells[isDirtyColumn].Value = true;
|
||||
dataGridView.Rows[i + 1].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||
}
|
||||
dataGridView.Rows[i + 1].Cells[isHeaderColumn].Value = false;
|
||||
dataGridView.Rows[i + 1].Cells[isMemberColumn].Value = true;
|
||||
dataGridView.Rows[i + 1].DefaultCellStyle.BackColor = Color.LightBlue;
|
||||
}
|
||||
//IF previous row is Incomplete, then call the stable PaintRowGroups function.
|
||||
else if (rowStatus == RowAttribute.IncompleteRow)
|
||||
{
|
||||
@@ -108,11 +131,21 @@ namespace AdvertsingProfitControl
|
||||
rowStatus = parser.GetRowAttribute(dataGridView.Rows[i + 1]);
|
||||
if (rowStatus == RowAttribute.MemberRow)
|
||||
{
|
||||
//Set the previous row as a header row.
|
||||
//Set the current row and check for changes.
|
||||
if (!(bool)dataGridView.Rows[i].Cells[isHeaderColumn].EditedFormattedValue)
|
||||
{
|
||||
dataGridView.Rows[i].Cells[isDirtyColumn].Value = true;
|
||||
dataGridView.Rows[i].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||
}
|
||||
dataGridView.Rows[i].Cells[isHeaderColumn].Value = true;
|
||||
dataGridView.Rows[i].Cells[isMemberColumn].Value = false;
|
||||
dataGridView.Rows[i].DefaultCellStyle.BackColor = Color.LightGray;
|
||||
//Set the next row as a member row.
|
||||
if (!(bool)dataGridView.Rows[i + 1].Cells[isMemberColumn].EditedFormattedValue)
|
||||
{
|
||||
dataGridView.Rows[i + 1].Cells[isDirtyColumn].Value = true;
|
||||
dataGridView.Rows[i + 1].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||
}
|
||||
dataGridView.Rows[i + 1].Cells[isHeaderColumn].Value = false;
|
||||
dataGridView.Rows[i + 1].Cells[isMemberColumn].Value = true;
|
||||
dataGridView.Rows[i + 1].DefaultCellStyle.BackColor = Color.LightBlue;
|
||||
|
||||
Reference in New Issue
Block a user