private TemplateConditionalFormatting bindFormatting(DataRow dr) { TemplateConditionalFormatting format = new TemplateConditionalFormatting(); format.op = dr["op"].ToString(); format.number = decimal.Parse(dr["number"].ToString()); //get color parts string[] colorParts = dr["color"].ToString().Split(new string[] { "#" }, StringSplitOptions.None); format.highlightColor = Color.FromArgb(int.Parse(colorParts[0]), int.Parse(colorParts[1]), int.Parse(colorParts[2]), int.Parse(colorParts[3])); format.formattingID = dr["formattingID"].ToString(); return(format); }
private void button1_Click(object sender, EventArgs e) { if (!validateInputs(panel1)) { return; } TemplateConditionalFormatting condFormat = new TemplateConditionalFormatting(); condFormat.highlightColor = txtColor.BackColor; condFormat.number = decimal.Parse(txtNumber.Text); condFormat.op = bOperator.Text; tempMethods.insertFormatting(selectedColumn, bOperator.Text, decimal.Parse(txtNumber.Text), txtColor.BackColor); loadFormats(); }