Last active
June 6, 2019 15:37
-
-
Save bjoerntx/6985f48e37cb82e763f519a70e8b251f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a new dialog form | |
frmCellFormat frmCellFormat = new frmCellFormat(); | |
// check, if there are existing filter instructions | |
CellFilterInstructions cellFilterInstructions = | |
(CellFilterInstructions)JsonConvert.DeserializeObject( | |
textControl1.Tables.GetItem().Cells.GetItem().Name, | |
typeof(CellFilterInstructions)); | |
if (cellFilterInstructions == null) | |
{ | |
// create new instructions | |
Color cCellBackColor = textControl1.Tables.GetItem().Cells.GetItem().CellFormat.BackColor; | |
cellFilterInstructions = new CellFilterInstructions() | |
{ | |
TrueColor = cCellBackColor, | |
FalseColor = cCellBackColor | |
}; | |
} | |
// show the form | |
frmCellFormat.CellFilterInstructions = cellFilterInstructions; | |
if (frmCellFormat.ShowDialog() == DialogResult.OK) | |
{ | |
// save the instructions in the Name property | |
textControl1.Tables.GetItem().Cells.GetItem().Name = | |
JsonConvert.SerializeObject(frmCellFormat.CellFilterInstructions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment