Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active June 6, 2019 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/6985f48e37cb82e763f519a70e8b251f to your computer and use it in GitHub Desktop.
Save bjoerntx/6985f48e37cb82e763f519a70e8b251f to your computer and use it in GitHub Desktop.
// 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