private void level3ReplaceLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { bool restrictToSelected = false; bool checked_found = false; bool unchecked_found = false; foreach (Serial_Hierarchy_Row controlRow in rows) { if ((controlRow.Checked) && (!checked_found)) { checked_found = true; } if ((!controlRow.Checked) && (!unchecked_found)) { unchecked_found = true; } } if ((checked_found) && (unchecked_found)) { restrictToSelected = true; } Find_Replace_Form replaceForm = new Find_Replace_Form(restrictToSelected); replaceForm.ShowDialog(); if ((!replaceForm.Cancelled) && (replaceForm.Find_Value.Length > 0)) { if (replaceForm.Checked_Rows_Only) { foreach (Serial_Hierarchy_Row controlRow in rows) { if (controlRow.Checked) { controlRow.Serial_Hierarchy[level3TextColumn] = controlRow.Serial_Hierarchy[level3TextColumn].ToString().Replace(replaceForm.Find_Value, replaceForm.Replace_Value); } } } else { foreach (DataRow itemRow in groupInfo.Item_Table.Rows) { itemRow[level3TextColumn] = itemRow[level3TextColumn].ToString().Replace(replaceForm.Find_Value, replaceForm.Replace_Value); } } } show_serial_hierarchy(); }
private void level3ReplaceLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { bool restrictToSelected = false; bool checked_found = false; bool unchecked_found = false; foreach (Serial_Hierarchy_Row controlRow in rows) { if ((controlRow.Checked) && (!checked_found)) { checked_found = true; } if ((!controlRow.Checked) && (!unchecked_found)) { unchecked_found = true; } } if ((checked_found) && (unchecked_found)) restrictToSelected = true; Find_Replace_Form replaceForm = new Find_Replace_Form(restrictToSelected); replaceForm.ShowDialog(); if ((!replaceForm.Cancelled) && (replaceForm.Find_Value.Length > 0)) { if (replaceForm.Checked_Rows_Only) { foreach (Serial_Hierarchy_Row controlRow in rows) { if (controlRow.Checked) { controlRow.Serial_Hierarchy[level3TextColumn] = controlRow.Serial_Hierarchy[level3TextColumn].ToString().Replace(replaceForm.Find_Value, replaceForm.Replace_Value); } } } else { foreach (DataRow itemRow in groupInfo.Item_Table.Rows) { itemRow[level3TextColumn] = itemRow[level3TextColumn].ToString().Replace(replaceForm.Find_Value, replaceForm.Replace_Value); } } } show_serial_hierarchy(); }